
// -----------
// This file was generated by riscv_ctg (https://gitlab.com/incoresemi/riscv-compliance/riscv_ctg)
// version   : 0.4.1
// timestamp : Wed Dec 16 04:49:48 2020 GMT
// usage     : riscv_ctg \
//                  -- cgf ('/scratch/git-repo/incoresemi/riscv-compliance/riscv_ctg/sample_cgfs/dataset.cgf', '/scratch/git-repo/incoresemi/riscv-compliance/riscv_ctg/sample_cgfs/rv64ic.cgf') \
//                  -- xlen 64 \
// -----------
//
// -----------
// Copyright (c) 2020. RISC-V International. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause
// -----------
//
// This assembly file tests the c.jr instruction of the RISC-V C extension for the cjr covergroup.
// 
#include "model_test.h"
#include "arch_test.h"
RVTEST_ISA("RV64IC")

.section .text.init
.globl rvtest_entry_point
rvtest_entry_point:
RVMODEL_BOOT
RVTEST_CODE_BEGIN

#ifdef TEST_CASE_1

RVTEST_CASE(0,"//check ISA:=regex(.*64.*);check ISA:=regex(.*I.*C.*);def TEST_CASE_1=True;",cjr)

RVTEST_SIGBASE( x23,signature_x23_1)

inst_0:
// rs1==x5, 
// opcode: c.jr; op1:x5
TEST_CJR_OP(x25, x5, x23, 0)

inst_1:
// rs1==x11, 
// opcode: c.jr; op1:x11
TEST_CJR_OP(x25, x11, x23, 8)

inst_2:
// rs1==x17, 
// opcode: c.jr; op1:x17
TEST_CJR_OP(x25, x17, x23, 16)

inst_3:
// rs1==x16, 
// opcode: c.jr; op1:x16
TEST_CJR_OP(x25, x16, x23, 24)

inst_4:
// rs1==x26, 
// opcode: c.jr; op1:x26
TEST_CJR_OP(x25, x26, x23, 32)

inst_5:
// rs1==x27, 
// opcode: c.jr; op1:x27
TEST_CJR_OP(x25, x27, x23, 40)

inst_6:
// rs1==x22, 
// opcode: c.jr; op1:x22
TEST_CJR_OP(x25, x22, x23, 48)

inst_7:
// rs1==x13, 
// opcode: c.jr; op1:x13
TEST_CJR_OP(x25, x13, x23, 56)

inst_8:
// rs1==x14, 
// opcode: c.jr; op1:x14
TEST_CJR_OP(x25, x14, x23, 64)

inst_9:
// rs1==x4, 
// opcode: c.jr; op1:x4
TEST_CJR_OP(x25, x4, x23, 72)

inst_10:
// rs1==x24, 
// opcode: c.jr; op1:x24
TEST_CJR_OP(x25, x24, x23, 80)

inst_11:
// rs1==x19, 
// opcode: c.jr; op1:x19
TEST_CJR_OP(x25, x19, x23, 88)

inst_12:
// rs1==x8, 
// opcode: c.jr; op1:x8
TEST_CJR_OP(x25, x8, x23, 96)

inst_13:
// rs1==x2, 
// opcode: c.jr; op1:x2
TEST_CJR_OP(x25, x2, x23, 104)

inst_14:
// rs1==x20, 
// opcode: c.jr; op1:x20
TEST_CJR_OP(x25, x20, x23, 112)

inst_15:
// rs1==x6, 
// opcode: c.jr; op1:x6
TEST_CJR_OP(x25, x6, x23, 120)

inst_16:
// rs1==x18, 
// opcode: c.jr; op1:x18
TEST_CJR_OP(x25, x18, x23, 128)

inst_17:
// rs1==x21, 
// opcode: c.jr; op1:x21
TEST_CJR_OP(x25, x21, x23, 136)

inst_18:
// rs1==x3, 
// opcode: c.jr; op1:x3
TEST_CJR_OP(x25, x3, x23, 144)

inst_19:
// rs1==x9, 
// opcode: c.jr; op1:x9
TEST_CJR_OP(x25, x9, x23, 152)

inst_20:
// rs1==x30, 
// opcode: c.jr; op1:x30
TEST_CJR_OP(x25, x30, x23, 160)

inst_21:
// rs1==x1, 
// opcode: c.jr; op1:x1
TEST_CJR_OP(x25, x1, x23, 168)

inst_22:
// rs1==x7, 
// opcode: c.jr; op1:x7
TEST_CJR_OP(x25, x7, x23, 176)

inst_23:
// rs1==x15, 
// opcode: c.jr; op1:x15
TEST_CJR_OP(x25, x15, x23, 184)

inst_24:
// rs1==x12, 
// opcode: c.jr; op1:x12
TEST_CJR_OP(x25, x12, x23, 192)

inst_25:
// rs1==x31, 
// opcode: c.jr; op1:x31
TEST_CJR_OP(x25, x31, x23, 200)

inst_26:
// rs1==x29, 
// opcode: c.jr; op1:x29
TEST_CJR_OP(x2, x29, x23, 208)
RVTEST_SIGBASE( x1,signature_x1_0)

inst_27:
// rs1==x25, 
// opcode: c.jr; op1:x25
TEST_CJR_OP(x2, x25, x1, 0)

inst_28:
// rs1==x28, 
// opcode: c.jr; op1:x28
TEST_CJR_OP(x2, x28, x1, 8)

inst_29:
// rs1==x23, 
// opcode: c.jr; op1:x23
TEST_CJR_OP(x2, x23, x1, 16)

inst_30:
// rs1==x10, 
// opcode: c.jr; op1:x10
TEST_CJR_OP(x2, x10, x1, 24)
#endif


RVTEST_CODE_END
RVMODEL_HALT

RVTEST_DATA_BEGIN
.align 4
rvtest_data:
.word 0xbabecafe
RVTEST_DATA_END

RVMODEL_DATA_BEGIN


signature_x23_0:
    .fill 0*(XLEN/32),4,0xdeadbeef


signature_x23_1:
    .fill 27*(XLEN/32),4,0xdeadbeef


signature_x1_0:
    .fill 4*(XLEN/32),4,0xdeadbeef

#ifdef rvtest_mtrap_routine

mtrap_sigptr:
    .fill 64*(XLEN/32),4,0xdeadbeef

#endif

#ifdef rvtest_gpr_save

gpr_save:
    .fill 32*(XLEN/32),4,0xdeadbeef

#endif

RVMODEL_DATA_END
