
// -----------
// This file was generated by riscv_ctg (https://github.com/riscv-software-src/riscv-ctg)
// version   : 0.11.1
// timestamp : Tue Jun 20 09:43:04 2023 GMT
// usage     : riscv_ctg \
//                  -- cgf //                  --cgf /home/abd/abd-data/riscv-ctg/sample_cgfs/dataset.cgf \
//                  --cgf /home/abd/abd-data/riscv-ctg/sample_cgfs/rv32i_zcb.cgf \
 \
//                  -- xlen 32  \
//                  --randomize \
// -----------
//
// -----------
// Copyright (c) 2020. RISC-V International. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause
// -----------
//
// This assembly file tests the c.sext.h instruction of the RISC-V RV32_Zca_Zcb_Zbb extension for the csext.h covergroup.
// 
#include "model_test.h"
#include "arch_test.h"
RVTEST_ISA("RV32I_Zca_Zcb_Zbb")

.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(.*32.*I.*Zca.*Zcb.*.Zbb.*);def TEST_CASE_1=True;",csext.h)

RVTEST_SIGBASE(x1,signature_x1_1)

inst_0:
// rs1==x9, rs1_val == 0, 
// opcode: c.sext.h ; op1=dest:x9 ; op1val:0x0;
TEST_CRD_OP(c.sext.h, x9, 0x00000000, 0x0, x1, 0*XLEN/8, x2)

inst_1:
// rs1==x12, rs1_val == 0x800, rs1_val == 2048
// opcode: c.sext.h ; op1=dest:x12 ; op1val:0x800;
TEST_CRD_OP(c.sext.h, x12, 0x00000000, 0x800, x1, 1*XLEN/8, x2)

inst_2:
// rs1==x10, rs1_val == 0xFF80, 
// opcode: c.sext.h ; op1=dest:x10 ; op1val:0xff80;
TEST_CRD_OP(c.sext.h, x10, 0x00000000, 0xff80, x1, 2*XLEN/8, x2)

inst_3:
// rs1==x15, rs1_val == 1, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0x1;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0x1, x1, 3*XLEN/8, x2)

inst_4:
// rs1==x14, rs1_val == 4294967294, 
// opcode: c.sext.h ; op1=dest:x14 ; op1val:0xfffffffe;
TEST_CRD_OP(c.sext.h, x14, 0x00000000, 0xfffffffe, x1, 4*XLEN/8, x2)

inst_5:
// rs1==x13, rs1_val == 4294967293, 
// opcode: c.sext.h ; op1=dest:x13 ; op1val:0xfffffffd;
TEST_CRD_OP(c.sext.h, x13, 0x00000000, 0xfffffffd, x1, 5*XLEN/8, x2)

inst_6:
// rs1==x11, rs1_val == 4294967291, 
// opcode: c.sext.h ; op1=dest:x11 ; op1val:0xfffffffb;
TEST_CRD_OP(c.sext.h, x11, 0x00000000, 0xfffffffb, x1, 6*XLEN/8, x2)

inst_7:
// rs1==x8, rs1_val == 4294967287, 
// opcode: c.sext.h ; op1=dest:x8 ; op1val:0xfffffff7;
TEST_CRD_OP(c.sext.h, x8, 0x00000000, 0xfffffff7, x1, 7*XLEN/8, x2)

inst_8:
// rs1_val == 4294967279, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0xffffffef;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0xffffffef, x1, 8*XLEN/8, x2)

inst_9:
// rs1_val == 4294967263, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0xffffffdf;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0xffffffdf, x1, 9*XLEN/8, x2)

inst_10:
// rs1_val == 4294967231, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0xffffffbf;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0xffffffbf, x1, 10*XLEN/8, x2)

inst_11:
// rs1_val == 4294967167, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0xffffff7f;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0xffffff7f, x1, 11*XLEN/8, x2)

inst_12:
// rs1_val == 4294967039, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0xfffffeff;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0xfffffeff, x1, 12*XLEN/8, x2)

inst_13:
// rs1_val == 4294966783, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0xfffffdff;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0xfffffdff, x1, 13*XLEN/8, x2)

inst_14:
// rs1_val == 4294966271, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0xfffffbff;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0xfffffbff, x1, 14*XLEN/8, x2)

inst_15:
// rs1_val == 4294965247, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0xfffff7ff;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0xfffff7ff, x1, 15*XLEN/8, x2)

inst_16:
// rs1_val == 4294963199, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0xffffefff;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0xffffefff, x1, 16*XLEN/8, x2)

inst_17:
// rs1_val == 4294959103, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0xffffdfff;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0xffffdfff, x1, 17*XLEN/8, x2)

inst_18:
// rs1_val == 4294950911, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0xffffbfff;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0xffffbfff, x1, 18*XLEN/8, x2)

inst_19:
// rs1_val == 4294934527, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0xffff7fff;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0xffff7fff, x1, 19*XLEN/8, x2)

inst_20:
// rs1_val == 4294901759, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0xfffeffff;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0xfffeffff, x1, 20*XLEN/8, x2)

inst_21:
// rs1_val == 4294836223, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0xfffdffff;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0xfffdffff, x1, 21*XLEN/8, x2)

inst_22:
// rs1_val == 4294705151, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0xfffbffff;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0xfffbffff, x1, 22*XLEN/8, x2)

inst_23:
// rs1_val == 4294443007, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0xfff7ffff;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0xfff7ffff, x1, 23*XLEN/8, x2)

inst_24:
// rs1_val == 4293918719, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0xffefffff;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0xffefffff, x1, 24*XLEN/8, x2)

inst_25:
// rs1_val == 4292870143, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0xffdfffff;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0xffdfffff, x1, 25*XLEN/8, x2)

inst_26:
// rs1_val == 4290772991, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0xffbfffff;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0xffbfffff, x1, 26*XLEN/8, x2)

inst_27:
// rs1_val == 4286578687, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0xff7fffff;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0xff7fffff, x1, 27*XLEN/8, x2)

inst_28:
// rs1_val == 4278190079, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0xfeffffff;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0xfeffffff, x1, 28*XLEN/8, x2)

inst_29:
// rs1_val == 4261412863, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0xfdffffff;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0xfdffffff, x1, 29*XLEN/8, x2)

inst_30:
// rs1_val == 4227858431, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0xfbffffff;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0xfbffffff, x1, 30*XLEN/8, x2)

inst_31:
// rs1_val == 4160749567, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0xf7ffffff;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0xf7ffffff, x1, 31*XLEN/8, x2)

inst_32:
// rs1_val == 4026531839, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0xefffffff;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0xefffffff, x1, 32*XLEN/8, x2)

inst_33:
// rs1_val == 3758096383, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0xdfffffff;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0xdfffffff, x1, 33*XLEN/8, x2)

inst_34:
// rs1_val == 3221225471, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0xbfffffff;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0xbfffffff, x1, 34*XLEN/8, x2)

inst_35:
// rs1_val == 536870912, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0x20000000;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0x20000000, x1, 35*XLEN/8, x2)

inst_36:
// rs1_val == 1073741824, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0x40000000;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0x40000000, x1, 36*XLEN/8, x2)

inst_37:
// rs1_val == 2147483648, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0x80000000;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0x80000000, x1, 37*XLEN/8, x2)

inst_38:
// rs1_val == 2147483647, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0x7fffffff;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0x7fffffff, x1, 38*XLEN/8, x2)

inst_39:
// rs1_val == 2, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0x2;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0x2, x1, 39*XLEN/8, x2)

inst_40:
// rs1_val == 4, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0x4;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0x4, x1, 40*XLEN/8, x2)

inst_41:
// rs1_val == 8, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0x8;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0x8, x1, 41*XLEN/8, x2)

inst_42:
// rs1_val == 16, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0x10;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0x10, x1, 42*XLEN/8, x2)

inst_43:
// rs1_val == 32, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0x20;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0x20, x1, 43*XLEN/8, x2)

inst_44:
// rs1_val == 64, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0x40;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0x40, x1, 44*XLEN/8, x2)

inst_45:
// rs1_val == 128, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0x80;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0x80, x1, 45*XLEN/8, x2)

inst_46:
// rs1_val == 256, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0x100;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0x100, x1, 46*XLEN/8, x2)

inst_47:
// rs1_val == 512, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0x200;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0x200, x1, 47*XLEN/8, x2)

inst_48:
// rs1_val == 1024, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0x400;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0x400, x1, 48*XLEN/8, x2)

inst_49:
// rs1_val == 4096, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0x1000;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0x1000, x1, 49*XLEN/8, x2)

inst_50:
// rs1_val == 8192, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0x2000;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0x2000, x1, 50*XLEN/8, x2)

inst_51:
// rs1_val == 16384, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0x4000;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0x4000, x1, 51*XLEN/8, x2)

inst_52:
// rs1_val == 32768, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0x8000;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0x8000, x1, 52*XLEN/8, x2)

inst_53:
// rs1_val == 65536, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0x10000;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0x10000, x1, 53*XLEN/8, x2)

inst_54:
// rs1_val == 131072, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0x20000;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0x20000, x1, 54*XLEN/8, x2)

inst_55:
// rs1_val == 262144, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0x40000;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0x40000, x1, 55*XLEN/8, x2)

inst_56:
// rs1_val == 524288, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0x80000;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0x80000, x1, 56*XLEN/8, x2)

inst_57:
// rs1_val == 1048576, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0x100000;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0x100000, x1, 57*XLEN/8, x2)

inst_58:
// rs1_val == 2097152, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0x200000;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0x200000, x1, 58*XLEN/8, x2)

inst_59:
// rs1_val == 4194304, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0x400000;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0x400000, x1, 59*XLEN/8, x2)

inst_60:
// rs1_val == 8388608, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0x800000;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0x800000, x1, 60*XLEN/8, x2)

inst_61:
// rs1_val == 16777216, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0x1000000;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0x1000000, x1, 61*XLEN/8, x2)

inst_62:
// rs1_val == 33554432, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0x2000000;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0x2000000, x1, 62*XLEN/8, x2)

inst_63:
// rs1_val == 67108864, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0x4000000;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0x4000000, x1, 63*XLEN/8, x2)

inst_64:
// rs1_val == 134217728, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0x8000000;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0x8000000, x1, 64*XLEN/8, x2)

inst_65:
// rs1_val == 268435456, 
// opcode: c.sext.h ; op1=dest:x15 ; op1val:0x10000000;
TEST_CRD_OP(c.sext.h, x15, 0x00000000, 0x10000000, x1, 65*XLEN/8, x2)
#endif


RVTEST_CODE_END
RVMODEL_HALT

RVTEST_DATA_BEGIN
.align 4
rvtest_data:
.word 0xbabecafe
.word 0xabecafeb
.word 0xbecafeba
.word 0xecafebab
RVTEST_DATA_END

RVMODEL_DATA_BEGIN
rvtest_sig_begin:
sig_begin_canary:
CANARY;



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


signature_x1_1:
    .fill 66*((XLEN/8)/4),4,0xdeadbeef

#ifdef rvtest_mtrap_routine
tsig_begin_canary:
CANARY;

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

tsig_end_canary:
CANARY;
#endif

#ifdef rvtest_gpr_save

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

#endif


sig_end_canary:
CANARY;
rvtest_sig_end:
RVMODEL_DATA_END
