
// -----------
// This file was generated by riscv_ctg (https://github.com/riscv-software-src/riscv-ctg)
// version   : 0.7.1
// timestamp : Fri Jun 17 14:03:17 2022 GMT
// usage     : riscv_ctg \
//                  -- cgf //                  --cgf /scratch/pawan/work/normalised/RV64F/fcvt.s.l.cgf \
 \
//                  -- xlen 64  \
//                  --randomize \
// -----------
//
// -----------
// Copyright (c) 2020. RISC-V International. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause
// -----------
//
// This assembly file tests the fcvt.s.l instruction of the RISC-V RV64F_Zicsr,RV64FD_Zicsr extension for the fcvt.s.l_b25 covergroup.
// 
#include "model_test.h"
#include "arch_test.h"
RVTEST_ISA("RV64IF_Zicsr,RV64IFD_Zicsr")

.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(.*RV64.*I.*F.*);def TEST_CASE_1=True;",fcvt.s.l_b25)

RVTEST_FP_ENABLE()
RVTEST_VALBASEUPD(x2,test_dataset_0)
RVTEST_SIGBASE(x8,signature_x8_1)

inst_0:// rs1==x26, rd==f5,rs1_val == -1 and  fcsr == 0 and rm_val == 7  
/* opcode: fcvt.s.l ; op1:x26; dest:f5; op1val:-0x1; valaddr_reg:x2;
val_offset:0*8; rmval:dyn; correctval:??; testreg:x10;
fcsr_val: 0*/
TEST_FPIO_OP(fcvt.s.l, f5, x26, dyn, 0, 0, x2, 0*8, x5, x8, x10,ld)

inst_1:// rs1==x18, rd==f2,rs1_val == -5270258713649211392 and  fcsr == 0 and rm_val == 7  
/* opcode: fcvt.s.l ; op1:x18; dest:f2; op1val:-0x4923b8608577e800; valaddr_reg:x2;
val_offset:1*8; rmval:dyn; correctval:??; testreg:x10;
fcsr_val: 0*/
TEST_FPIO_OP(fcvt.s.l, f2, x18, dyn, 0, 0, x2, 1*8, x5, x8, x10,ld)

inst_2:// rs1==x24, rd==f6,rs1_val == -9223372036854775807 and  fcsr == 0 and rm_val == 7  
/* opcode: fcvt.s.l ; op1:x24; dest:f6; op1val:-0x7fffffffffffffff; valaddr_reg:x2;
val_offset:2*8; rmval:dyn; correctval:??; testreg:x10;
fcsr_val: 0*/
TEST_FPIO_OP(fcvt.s.l, f6, x24, dyn, 0, 0, x2, 2*8, x5, x8, x10,ld)

inst_3:// rs1==x22, rd==f3,rs1_val == 0 and  fcsr == 0 and rm_val == 7  
/* opcode: fcvt.s.l ; op1:x22; dest:f3; op1val:0x0; valaddr_reg:x2;
val_offset:3*8; rmval:dyn; correctval:??; testreg:x10;
fcsr_val: 0*/
TEST_FPIO_OP(fcvt.s.l, f3, x22, dyn, 0, 0, x2, 3*8, x5, x8, x10,ld)

inst_4:// rs1==x1, rd==f13,rs1_val == 1 and  fcsr == 0 and rm_val == 7  
/* opcode: fcvt.s.l ; op1:x1; dest:f13; op1val:0x1; valaddr_reg:x2;
val_offset:4*8; rmval:dyn; correctval:??; testreg:x10;
fcsr_val: 0*/
TEST_FPIO_OP(fcvt.s.l, f13, x1, dyn, 0, 0, x2, 4*8, x5, x8, x10,ld)

inst_5:// rs1==x25, rd==f11,rs1_val == 5270258713649211392 and  fcsr == 0 and rm_val == 7  
/* opcode: fcvt.s.l ; op1:x25; dest:f11; op1val:0x4923b8608577e800; valaddr_reg:x2;
val_offset:5*8; rmval:dyn; correctval:??; testreg:x10;
fcsr_val: 0*/
TEST_FPIO_OP(fcvt.s.l, f11, x25, dyn, 0, 0, x2, 5*8, x5, x8, x10,ld)

inst_6:// rs1==x27, rd==f1,rs1_val == 9223372036854775807 and  fcsr == 0 and rm_val == 7  
/* opcode: fcvt.s.l ; op1:x27; dest:f1; op1val:0x7fffffffffffffff; valaddr_reg:x2;
val_offset:6*8; rmval:dyn; correctval:??; testreg:x10;
fcsr_val: 0*/
TEST_FPIO_OP(fcvt.s.l, f1, x27, dyn, 0, 0, x2, 6*8, x5, x8, x10,ld)

inst_7:// rs1==x16, rd==f24,
/* opcode: fcvt.s.l ; op1:x16; dest:f24; op1val:0x0; valaddr_reg:x2;
val_offset:7*8; rmval:dyn; correctval:??; testreg:x10;
fcsr_val: 0*/
TEST_FPIO_OP(fcvt.s.l, f24, x16, dyn, 0, 0, x2, 7*8, x5, x8, x10,ld)

inst_8:// rs1==x13, rd==f31,
/* opcode: fcvt.s.l ; op1:x13; dest:f31; op1val:0x0; valaddr_reg:x2;
val_offset:8*8; rmval:dyn; correctval:??; testreg:x10;
fcsr_val: 0*/
TEST_FPIO_OP(fcvt.s.l, f31, x13, dyn, 0, 0, x2, 8*8, x5, x8, x10,ld)

inst_9:// rs1==x9, rd==f7,
/* opcode: fcvt.s.l ; op1:x9; dest:f7; op1val:0x0; valaddr_reg:x2;
val_offset:9*8; rmval:dyn; correctval:??; testreg:x10;
fcsr_val: 0*/
TEST_FPIO_OP(fcvt.s.l, f7, x9, dyn, 0, 0, x2, 9*8, x5, x8, x10,ld)

inst_10:// rs1==x23, rd==f21,
/* opcode: fcvt.s.l ; op1:x23; dest:f21; op1val:0x0; valaddr_reg:x2;
val_offset:10*8; rmval:dyn; correctval:??; testreg:x10;
fcsr_val: 0*/
TEST_FPIO_OP(fcvt.s.l, f21, x23, dyn, 0, 0, x2, 10*8, x5, x8, x10,ld)

inst_11:// rs1==x6, rd==f28,
/* opcode: fcvt.s.l ; op1:x6; dest:f28; op1val:0x0; valaddr_reg:x2;
val_offset:11*8; rmval:dyn; correctval:??; testreg:x10;
fcsr_val: 0*/
TEST_FPIO_OP(fcvt.s.l, f28, x6, dyn, 0, 0, x2, 11*8, x5, x8, x10,ld)

inst_12:// rs1==x0, rd==f14,
/* opcode: fcvt.s.l ; op1:x0; dest:f14; op1val:0x0; valaddr_reg:x2;
val_offset:12*8; rmval:dyn; correctval:??; testreg:x10;
fcsr_val: 0*/
TEST_FPIO_OP(fcvt.s.l, f14, x0, dyn, 0, 0, x2, 12*8, x5, x8, x10,ld)

inst_13:// rs1==x30, rd==f29,
/* opcode: fcvt.s.l ; op1:x30; dest:f29; op1val:0x0; valaddr_reg:x2;
val_offset:13*8; rmval:dyn; correctval:??; testreg:x10;
fcsr_val: 0*/
TEST_FPIO_OP(fcvt.s.l, f29, x30, dyn, 0, 0, x2, 13*8, x5, x8, x10,ld)

inst_14:// rs1==x21, rd==f4,
/* opcode: fcvt.s.l ; op1:x21; dest:f4; op1val:0x0; valaddr_reg:x2;
val_offset:14*8; rmval:dyn; correctval:??; testreg:x10;
fcsr_val: 0*/
TEST_FPIO_OP(fcvt.s.l, f4, x21, dyn, 0, 0, x2, 14*8, x5, x8, x10,ld)

inst_15:// rs1==x28, rd==f0,
/* opcode: fcvt.s.l ; op1:x28; dest:f0; op1val:0x0; valaddr_reg:x2;
val_offset:15*8; rmval:dyn; correctval:??; testreg:x10;
fcsr_val: 0*/
TEST_FPIO_OP(fcvt.s.l, f0, x28, dyn, 0, 0, x2, 15*8, x5, x8, x10,ld)

inst_16:// rs1==x7, rd==f9,
/* opcode: fcvt.s.l ; op1:x7; dest:f9; op1val:0x0; valaddr_reg:x2;
val_offset:16*8; rmval:dyn; correctval:??; testreg:x10;
fcsr_val: 0*/
TEST_FPIO_OP(fcvt.s.l, f9, x7, dyn, 0, 0, x2, 16*8, x5, x8, x10,ld)

inst_17:// rs1==x3, rd==f10,
/* opcode: fcvt.s.l ; op1:x3; dest:f10; op1val:0x0; valaddr_reg:x2;
val_offset:17*8; rmval:dyn; correctval:??; testreg:x10;
fcsr_val: 0*/
TEST_FPIO_OP(fcvt.s.l, f10, x3, dyn, 0, 0, x2, 17*8, x5, x8, x10,ld)

inst_18:// rs1==x14, rd==f18,
/* opcode: fcvt.s.l ; op1:x14; dest:f18; op1val:0x0; valaddr_reg:x2;
val_offset:18*8; rmval:dyn; correctval:??; testreg:x10;
fcsr_val: 0*/
TEST_FPIO_OP(fcvt.s.l, f18, x14, dyn, 0, 0, x2, 18*8, x5, x8, x10,ld)

inst_19:// rs1==x29, rd==f23,
/* opcode: fcvt.s.l ; op1:x29; dest:f23; op1val:0x0; valaddr_reg:x2;
val_offset:19*8; rmval:dyn; correctval:??; testreg:x10;
fcsr_val: 0*/
TEST_FPIO_OP(fcvt.s.l, f23, x29, dyn, 0, 0, x2, 19*8, x5, x8, x10,ld)

inst_20:// rs1==x17, rd==f22,
/* opcode: fcvt.s.l ; op1:x17; dest:f22; op1val:0x0; valaddr_reg:x2;
val_offset:20*8; rmval:dyn; correctval:??; testreg:x10;
fcsr_val: 0*/
TEST_FPIO_OP(fcvt.s.l, f22, x17, dyn, 0, 0, x2, 20*8, x5, x8, x10,ld)

inst_21:// rs1==x4, rd==f17,
/* opcode: fcvt.s.l ; op1:x4; dest:f17; op1val:0x0; valaddr_reg:x2;
val_offset:21*8; rmval:dyn; correctval:??; testreg:x10;
fcsr_val: 0*/
TEST_FPIO_OP(fcvt.s.l, f17, x4, dyn, 0, 0, x2, 21*8, x5, x8, x10,ld)

inst_22:// rs1==x20, rd==f16,
/* opcode: fcvt.s.l ; op1:x20; dest:f16; op1val:0x0; valaddr_reg:x2;
val_offset:22*8; rmval:dyn; correctval:??; testreg:x10;
fcsr_val: 0*/
TEST_FPIO_OP(fcvt.s.l, f16, x20, dyn, 0, 0, x2, 22*8, x5, x8, x10,ld)

inst_23:// rs1==x12, rd==f20,
/* opcode: fcvt.s.l ; op1:x12; dest:f20; op1val:0x0; valaddr_reg:x2;
val_offset:23*8; rmval:dyn; correctval:??; testreg:x10;
fcsr_val: 0*/
TEST_FPIO_OP(fcvt.s.l, f20, x12, dyn, 0, 0, x2, 23*8, x5, x8, x10,ld)

inst_24:// rs1==x19, rd==f26,
/* opcode: fcvt.s.l ; op1:x19; dest:f26; op1val:0x0; valaddr_reg:x2;
val_offset:24*8; rmval:dyn; correctval:??; testreg:x10;
fcsr_val: 0*/
TEST_FPIO_OP(fcvt.s.l, f26, x19, dyn, 0, 0, x2, 24*8, x5, x8, x10,ld)
RVTEST_VALBASEUPD(x3,test_dataset_1)

inst_25:// rs1==x5, rd==f27,
/* opcode: fcvt.s.l ; op1:x5; dest:f27; op1val:0x0; valaddr_reg:x3;
val_offset:0*8; rmval:dyn; correctval:??; testreg:x10;
fcsr_val: 0*/
TEST_FPIO_OP(fcvt.s.l, f27, x5, dyn, 0, 0, x3, 0*8, x4, x8, x10,ld)

inst_26:// rs1==x2, rd==f19,
/* opcode: fcvt.s.l ; op1:x2; dest:f19; op1val:0x0; valaddr_reg:x3;
val_offset:1*8; rmval:dyn; correctval:??; testreg:x10;
fcsr_val: 0*/
TEST_FPIO_OP(fcvt.s.l, f19, x2, dyn, 0, 0, x3, 1*8, x4, x8, x10,ld)

inst_27:// rs1==x15, rd==f25,
/* opcode: fcvt.s.l ; op1:x15; dest:f25; op1val:0x0; valaddr_reg:x3;
val_offset:2*8; rmval:dyn; correctval:??; testreg:x2;
fcsr_val: 0*/
TEST_FPIO_OP(fcvt.s.l, f25, x15, dyn, 0, 0, x3, 2*8, x4, x8, x2,ld)
RVTEST_SIGBASE(x1,signature_x1_0)

inst_28:// rs1==x31, rd==f15,
/* opcode: fcvt.s.l ; op1:x31; dest:f15; op1val:0x0; valaddr_reg:x3;
val_offset:3*8; rmval:dyn; correctval:??; testreg:x2;
fcsr_val: 0*/
TEST_FPIO_OP(fcvt.s.l, f15, x31, dyn, 0, 0, x3, 3*8, x4, x1, x2,ld)

inst_29:// rs1==x8, rd==f8,
/* opcode: fcvt.s.l ; op1:x8; dest:f8; op1val:0x0; valaddr_reg:x3;
val_offset:4*8; rmval:dyn; correctval:??; testreg:x2;
fcsr_val: 0*/
TEST_FPIO_OP(fcvt.s.l, f8, x8, dyn, 0, 0, x3, 4*8, x4, x1, x2,ld)

inst_30:// rs1==x10, rd==f12,
/* opcode: fcvt.s.l ; op1:x10; dest:f12; op1val:0x0; valaddr_reg:x3;
val_offset:5*8; rmval:dyn; correctval:??; testreg:x2;
fcsr_val: 0*/
TEST_FPIO_OP(fcvt.s.l, f12, x10, dyn, 0, 0, x3, 5*8, x4, x1, x2,ld)

inst_31:// rs1==x11, rd==f30,
/* opcode: fcvt.s.l ; op1:x11; dest:f30; op1val:0x0; valaddr_reg:x3;
val_offset:6*8; rmval:dyn; correctval:??; testreg:x2;
fcsr_val: 0*/
TEST_FPIO_OP(fcvt.s.l, f30, x11, dyn, 0, 0, x3, 6*8, x4, x1, x2,ld)

inst_32:// 
/* opcode: fcvt.s.l ; op1:x31; dest:f31; op1val:0x0; valaddr_reg:x3;
val_offset:7*8; rmval:dyn; correctval:??; testreg:x2;
fcsr_val: 0*/
TEST_FPIO_OP(fcvt.s.l, f31, x31, dyn, 0, 0, x3, 7*8, x4, x1, x2,ld)
#endif


RVTEST_CODE_END
RVMODEL_HALT

RVTEST_DATA_BEGIN
.align 4
rvtest_data:
.word 0xbabecafe
.word 0xabecafeb
.word 0xbecafeba
.word 0xecafebab
test_dataset_0:
.dword -1;
.dword -5270258713649211392;
.dword -9223372036854775807;
.dword 0;
.dword 1;
.dword 5270258713649211392;
.dword 9223372036854775807;
.dword 0;
.dword 0;
.dword 0;
.dword 0;
.dword 0;
.dword 0;
.dword 0;
.dword 0;
.dword 0;
.dword 0;
.dword 0;
.dword 0;
.dword 0;
.dword 0;
.dword 0;
.dword 0;
.dword 0;
.dword 0;
test_dataset_1:
.dword 0;
.dword 0;
.dword 0;
.dword 0;
.dword 0;
.dword 0;
.dword 0;
.dword 0;
RVTEST_DATA_END

RVMODEL_DATA_BEGIN
rvtest_sig_begin:
sig_begin_canary:
CANARY;


signature_x8_0:
    .fill 0*((SIGALIGN)/4),4,0xdeadbeef


signature_x8_1:
    .fill 56*((SIGALIGN)/4),4,0xdeadbeef


signature_x1_0:
    .fill 10*((SIGALIGN)/4),4,0xdeadbeef

#ifdef rvtest_mtrap_routine

tsig_begin_canary:
CANARY;
tsig_begin_canary:
CANARY;
mtrap_sigptr:
    .fill 64*(XLEN/32),4,0xdeadbeef
tsig_end_canary:
CANARY;
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
