
// -----------
// This file was generated by riscv_ctg (https://github.com/riscv-software-src/riscv-ctg)
// version   : 0.6.3
// timestamp : Sat Apr 23 14:53:29 2022 GMT
// usage     : riscv_ctg \
//                  --cgf /scratch/git-repo/github/riscv_ctg/sample_cgfs/dataset.cgf \
//                  --cgf /scratch/git-repo/github/riscv_ctg/sample_cgfs/rv32ip.cgf \
//                  --xlen 32  \
//                  --randomize \
// -----------
//
// -----------
// Copyright (c) 2020. RISC-V International. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause
// -----------
//
// This assembly file tests the sclip8 instruction of the RISC-V RV32PZicsr extension for the sclip8 covergroup.
// 
#include "model_test.h"
#include "arch_test.h"
RVTEST_ISA("RV32IPZicsr")

.section .text.init
.org 0x80
.globl rvtest_entry_point
rvtest_entry_point:
RVMODEL_BOOT
RVTEST_CODE_BEGIN

#ifdef TEST_CASE_1

RVTEST_CASE(0,"//check ISA:=regex(.*32.*);check ISA:=regex(.*I.*P.*Zicsr.*);def TEST_CASE_1=True;",sclip8)

RVTEST_VXSAT_ENABLE()
RVTEST_SIGBASE(x23,signature_x23_1)

inst_0:
// rs1 != rd, rs1==x26, rd==x31, rs1_b0_val == -128, imm_val == 7, rs1_b3_val == -1, rs1_b2_val == -128
// opcode: sclip8 ; op1:x26; dest:x31; op1val:0xff80f880;  immval:0x7
TEST_PKIMM_OP( sclip8, x31, x26, 0x00000000, 0xff80f880, 0x7, x26, x23, 0, x17)

inst_1:
// rs1 == rd, rs1==x8, rd==x8, imm_val == 6, rs1_b3_val == 85, rs1_b2_val == -86, rs1_b1_val == -9
// opcode: sclip8 ; op1:x8; dest:x8; op1val:0x55aaf7fc;  immval:0x6
TEST_PKIMM_OP( sclip8, x8, x8, 0x00000000, 0x55aaf7fc, 0x6, x8, x23, 8, x17)

inst_2:
// rs1==x31, rd==x1, imm_val == 5, rs1_b2_val == 64, rs1_b3_val == 64, rs1_b1_val == 16
// opcode: sclip8 ; op1:x31; dest:x1; op1val:0x40401003;  immval:0x5
TEST_PKIMM_OP( sclip8, x1, x31, 0x00000000, 0x40401003, 0x5, x31, x23, 16, x17)

inst_3:
// rs1==x22, rd==x13, imm_val == 4, rs1_b2_val == -2
// opcode: sclip8 ; op1:x22; dest:x13; op1val:0x5fefaf9;  immval:0x4
TEST_PKIMM_OP( sclip8, x13, x22, 0x00000000, 0x5fefaf9, 0x4, x22, x23, 24, x17)

inst_4:
// rs1==x3, rd==x2, imm_val == 3, rs1_b3_val == 127, rs1_b0_val == 2
// opcode: sclip8 ; op1:x3; dest:x2; op1val:0x7ffcf602;  immval:0x3
TEST_PKIMM_OP( sclip8, x2, x3, 0x00000000, 0x7ffcf602, 0x3, x3, x23, 32, x17)

inst_5:
// rs1==x18, rd==x14, imm_val == 2, rs1_b1_val == 2, rs1_b2_val == 32
// opcode: sclip8 ; op1:x18; dest:x14; op1val:0xf6200202;  immval:0x2
TEST_PKIMM_OP( sclip8, x14, x18, 0x00000000, 0xf6200202, 0x2, x18, x23, 40, x17)

inst_6:
// rs1==x24, rd==x9, imm_val == 1, rs1_b0_val == 16, rs1_b1_val == 85, rs1_b2_val == -3, rs1_b3_val == 8
// opcode: sclip8 ; op1:x24; dest:x9; op1val:0x8fd5510;  immval:0x1
TEST_PKIMM_OP( sclip8, x9, x24, 0x00000000, 0x8fd5510, 0x1, x24, x23, 48, x17)

inst_7:
// rs1==x19, rd==x4, imm_val == 0, rs1_b3_val == 1
// opcode: sclip8 ; op1:x19; dest:x4; op1val:0x120f9f6;  immval:0x0
TEST_PKIMM_OP( sclip8, x4, x19, 0x00000000, 0x120f9f6, 0x0, x19, x23, 56, x17)

inst_8:
// rs1==x25, rd==x29, rs1_b3_val == -86, rs1_b2_val == -33, rs1_b0_val == -17
// opcode: sclip8 ; op1:x25; dest:x29; op1val:0xaadf3fef;  immval:0x4
TEST_PKIMM_OP( sclip8, x29, x25, 0x00000000, 0xaadf3fef, 0x4, x25, x23, 64, x17)

inst_9:
// rs1==x5, rd==x30, rs1_b3_val == -65, rs1_b1_val == -5, rs1_b0_val == -86, rs1_b2_val == 2
// opcode: sclip8 ; op1:x5; dest:x30; op1val:0xbf02fbaa;  immval:0x5
TEST_PKIMM_OP( sclip8, x30, x5, 0x00000000, 0xbf02fbaa, 0x5, x5, x23, 72, x17)

inst_10:
// rs1==x11, rd==x20, rs1_b3_val == -33, rs1_b0_val == 4
// opcode: sclip8 ; op1:x11; dest:x20; op1val:0xdfc00904;  immval:0x6
TEST_PKIMM_OP( sclip8, x20, x11, 0x00000000, 0xdfc00904, 0x6, x11, x23, 80, x17)

inst_11:
// rs1==x6, rd==x21, rs1_b3_val == -17, rs1_b2_val == 4, rs1_b1_val == -65, rs1_b0_val == 127
// opcode: sclip8 ; op1:x6; dest:x21; op1val:0xef04bf7f;  immval:0x4
TEST_PKIMM_OP( sclip8, x21, x6, 0x00000000, 0xef04bf7f, 0x4, x6, x23, 88, x17)

inst_12:
// rs1==x13, rd==x10, rs1_b3_val == -9, 
// opcode: sclip8 ; op1:x13; dest:x10; op1val:0xf70609c0;  immval:0x2
TEST_PKIMM_OP( sclip8, x10, x13, 0x00000000, 0xf70609c0, 0x2, x13, x23, 96, x17)

inst_13:
// rs1==x15, rd==x5, rs1_b3_val == -5, rs1_b1_val == -33
// opcode: sclip8 ; op1:x15; dest:x5; op1val:0xfbc0dfc0;  immval:0x3
TEST_PKIMM_OP( sclip8, x5, x15, 0x00000000, 0xfbc0dfc0, 0x3, x15, x23, 104, x17)

inst_14:
// rs1==x10, rd==x11, rs1_b3_val == -3, rs1_b0_val == -2
// opcode: sclip8 ; op1:x10; dest:x11; op1val:0xfddf55fe;  immval:0x6
TEST_PKIMM_OP( sclip8, x11, x10, 0x00000000, 0xfddf55fe, 0x6, x10, x23, 112, x17)

inst_15:
// rs1==x16, rd==x25, rs1_b3_val == -2, rs1_b2_val == -1, rs1_b1_val == -86
// opcode: sclip8 ; op1:x16; dest:x25; op1val:0xfeffaa09;  immval:0x1
TEST_PKIMM_OP( sclip8, x25, x16, 0x00000000, 0xfeffaa09, 0x1, x16, x23, 120, x17)

inst_16:
// rs1==x30, rd==x12, rs1_b3_val == -128, rs1_b1_val == 1
// opcode: sclip8 ; op1:x30; dest:x12; op1val:0x80c001ef;  immval:0x6
TEST_PKIMM_OP( sclip8, x12, x30, 0x00000000, 0x80c001ef, 0x6, x30, x23, 128, x17)

inst_17:
// rs1==x7, rd==x3, rs1_b3_val == 32, 
// opcode: sclip8 ; op1:x7; dest:x3; op1val:0x20f9bff9;  immval:0x0
TEST_PKIMM_OP( sclip8, x3, x7, 0x00000000, 0x20f9bff9, 0x0, x7, x23, 136, x17)

inst_18:
// rs1==x14, rd==x22, rs1_b3_val == 16, rs1_b0_val == -65
// opcode: sclip8 ; op1:x14; dest:x22; op1val:0x10dff9bf;  immval:0x7
TEST_PKIMM_OP( sclip8, x22, x14, 0x00000000, 0x10dff9bf, 0x7, x14, x23, 144, x5)

inst_19:
// rs1==x0, rd==x17, rs1_b3_val == 4, 
// opcode: sclip8 ; op1:x0; dest:x17; op1val:0x48010bf;  immval:0x4
TEST_PKIMM_OP( sclip8, x17, x0, 0x00000000, 0x48010bf, 0x4, x0, x23, 152, x5)
RVTEST_SIGBASE(x3,signature_x3_0)

inst_20:
// rs1==x23, rd==x16, rs1_b3_val == 2, rs1_b1_val == 4
// opcode: sclip8 ; op1:x23; dest:x16; op1val:0x2fc0405;  immval:0x0
TEST_PKIMM_OP( sclip8, x16, x23, 0x00000000, 0x2fc0405, 0x0, x23, x3, 0, x5)

inst_21:
// rs1==x28, rd==x19, rs1_b3_val == 0, 
// opcode: sclip8 ; op1:x28; dest:x19; op1val:0xc0063f;  immval:0x4
TEST_PKIMM_OP( sclip8, x19, x28, 0x00000000, 0xc0063f, 0x4, x28, x3, 8, x5)

inst_22:
// rs1==x12, rd==x23, rs1_b1_val == 0, rs1_b2_val == 8, rs1_b0_val == 64
// opcode: sclip8 ; op1:x12; dest:x23; op1val:0x40080040;  immval:0x4
TEST_PKIMM_OP( sclip8, x23, x12, 0x00000000, 0x40080040, 0x4, x12, x3, 16, x5)

inst_23:
// rs1==x9, rd==x18, rs1_b1_val == -1, 
// opcode: sclip8 ; op1:x9; dest:x18; op1val:0xff40ff02;  immval:0x7
TEST_PKIMM_OP( sclip8, x18, x9, 0x00000000, 0xff40ff02, 0x7, x9, x3, 24, x5)

inst_24:
// rs1==x4, rd==x7, rs1_b0_val == 85, rs1_b2_val == 85
// opcode: sclip8 ; op1:x4; dest:x7; op1val:0xf8550955;  immval:0x6
TEST_PKIMM_OP( sclip8, x7, x4, 0x00000000, 0xf8550955, 0x6, x4, x3, 32, x5)

inst_25:
// rs1==x29, rd==x6, rs1_b0_val == -33, rs1_b2_val == 1
// opcode: sclip8 ; op1:x29; dest:x6; op1val:0x80110df;  immval:0x6
TEST_PKIMM_OP( sclip8, x6, x29, 0x00000000, 0x80110df, 0x6, x29, x3, 40, x5)

inst_26:
// rs1==x1, rd==x26, rs1_b0_val == -9, 
// opcode: sclip8 ; op1:x1; dest:x26; op1val:0x40dff6f7;  immval:0x4
TEST_PKIMM_OP( sclip8, x26, x1, 0x00000000, 0x40dff6f7, 0x4, x1, x3, 48, x5)

inst_27:
// rs1==x2, rd==x24, rs1_b0_val == -5, 
// opcode: sclip8 ; op1:x2; dest:x24; op1val:0xffc0f8fb;  immval:0x1
TEST_PKIMM_OP( sclip8, x24, x2, 0x00000000, 0xffc0f8fb, 0x1, x2, x3, 56, x5)

inst_28:
// rs1==x21, rd==x0, rs1_b0_val == -3, rs1_b2_val == -17
// opcode: sclip8 ; op1:x21; dest:x0; op1val:0xfdeff6fd;  immval:0x5
TEST_PKIMM_OP( sclip8, x0, x21, 0x00000000, 0xfdeff6fd, 0x5, x21, x3, 64, x5)

inst_29:
// rs1==x27, rd==x15, rs1_b0_val == 32, 
// opcode: sclip8 ; op1:x27; dest:x15; op1val:0xfb400320;  immval:0x0
TEST_PKIMM_OP( sclip8, x15, x27, 0x00000000, 0xfb400320, 0x0, x27, x3, 72, x5)

inst_30:
// rs1==x17, rd==x27, rs1_b0_val == 8, rs1_b2_val == 0
// opcode: sclip8 ; op1:x17; dest:x27; op1val:0x100fb08;  immval:0x2
TEST_PKIMM_OP( sclip8, x27, x17, 0x00000000, 0x100fb08, 0x2, x17, x3, 80, x5)

inst_31:
// rs1==x20, rd==x28, rs1_b0_val == 1, 
// opcode: sclip8 ; op1:x20; dest:x28; op1val:0xfcefaa01;  immval:0x2
TEST_PKIMM_OP( sclip8, x28, x20, 0x00000000, 0xfcefaa01, 0x2, x20, x3, 88, x5)

inst_32:
// rs1_b2_val == -65, 
// opcode: sclip8 ; op1:x30; dest:x31; op1val:0x80bffbf7;  immval:0x4
TEST_PKIMM_OP( sclip8, x31, x30, 0x00000000, 0x80bffbf7, 0x4, x30, x3, 96, x5)

inst_33:
// rs1_b2_val == -9, 
// opcode: sclip8 ; op1:x30; dest:x31; op1val:0x8f70004;  immval:0x4
TEST_PKIMM_OP( sclip8, x31, x30, 0x00000000, 0x8f70004, 0x4, x30, x3, 104, x5)

inst_34:
// rs1_b2_val == -5, 
// opcode: sclip8 ; op1:x30; dest:x31; op1val:0xbffbf855;  immval:0x6
TEST_PKIMM_OP( sclip8, x31, x30, 0x00000000, 0xbffbf855, 0x6, x30, x3, 112, x5)

inst_35:
// rs1_b2_val == 16, 
// opcode: sclip8 ; op1:x30; dest:x31; op1val:0xfb1003fa;  immval:0x2
TEST_PKIMM_OP( sclip8, x31, x30, 0x00000000, 0xfb1003fa, 0x2, x30, x3, 120, x5)

inst_36:
// rs1_b1_val == 8, 
// opcode: sclip8 ; op1:x30; dest:x31; op1val:0x3ff908fa;  immval:0x1
TEST_PKIMM_OP( sclip8, x31, x30, 0x00000000, 0x3ff908fa, 0x1, x30, x3, 128, x5)

inst_37:
// rs1_b1_val == 127, 
// opcode: sclip8 ; op1:x30; dest:x31; op1val:0xf8047f05;  immval:0x3
TEST_PKIMM_OP( sclip8, x31, x30, 0x00000000, 0xf8047f05, 0x3, x30, x3, 136, x5)

inst_38:
// rs1_b0_val == 0, rs1_b1_val == 64
// opcode: sclip8 ; op1:x30; dest:x31; op1val:0x55404000;  immval:0x3
TEST_PKIMM_OP( sclip8, x31, x30, 0x00000000, 0x55404000, 0x3, x30, x3, 144, x5)

inst_39:
// rs1_b1_val == -17, 
// opcode: sclip8 ; op1:x30; dest:x31; op1val:0xdf80effa;  immval:0x5
TEST_PKIMM_OP( sclip8, x31, x30, 0x00000000, 0xdf80effa, 0x5, x30, x3, 152, x5)

inst_40:
// rs1_b0_val == -1, 
// opcode: sclip8 ; op1:x30; dest:x31; op1val:0x53f06ff;  immval:0x1
TEST_PKIMM_OP( sclip8, x31, x30, 0x00000000, 0x53f06ff, 0x1, x30, x3, 160, x5)

inst_41:
// rs1_b1_val == -3, 
// opcode: sclip8 ; op1:x30; dest:x31; op1val:0x604fdaa;  immval:0x4
TEST_PKIMM_OP( sclip8, x31, x30, 0x00000000, 0x604fdaa, 0x4, x30, x3, 168, x5)

inst_42:
// rs1_b1_val == -2, 
// opcode: sclip8 ; op1:x30; dest:x31; op1val:0xc003fedf;  immval:0x7
TEST_PKIMM_OP( sclip8, x31, x30, 0x00000000, 0xc003fedf, 0x7, x30, x3, 176, x5)

inst_43:
// rs1_b1_val == -128, 
// opcode: sclip8 ; op1:x30; dest:x31; op1val:0xc0018005;  immval:0x2
TEST_PKIMM_OP( sclip8, x31, x30, 0x00000000, 0xc0018005, 0x2, x30, x3, 184, x5)

inst_44:
// rs1_b1_val == 32, 
// opcode: sclip8 ; op1:x30; dest:x31; op1val:0x7aa2010;  immval:0x3
TEST_PKIMM_OP( sclip8, x31, x30, 0x00000000, 0x7aa2010, 0x3, x30, x3, 192, x5)

inst_45:
// rs1_b2_val == 127, 
// opcode: sclip8 ; op1:x30; dest:x31; op1val:0x807f07fd;  immval:0x1
TEST_PKIMM_OP( sclip8, x31, x30, 0x00000000, 0x807f07fd, 0x1, x30, x3, 200, x5)

inst_46:
// rs1_b3_val == 4, 
// opcode: sclip8 ; op1:x30; dest:x31; op1val:0x48010bf;  immval:0x4
TEST_PKIMM_OP( sclip8, x31, x30, 0x00000000, 0x48010bf, 0x4, x30, x3, 208, x5)
#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


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


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


signature_x3_0:
    .fill 54*(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
