mirror of
https://github.com/vortexgpgpu/vortex.git
synced 2025-04-24 05:47:35 -04:00
simx lkg build
This commit is contained in:
parent
10a994d11a
commit
71e9745e68
7 changed files with 240 additions and 498 deletions
|
@ -159,7 +159,7 @@ public:
|
|||
}
|
||||
|
||||
int set_csr(int core_id, int addr, unsigned value) {
|
||||
cores_.at(core_id)->set_csr(addr, value);
|
||||
cores_.at(core_id)->set_csr(addr, value, 0, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ static const char* op_string(const Instr &instr) {
|
|||
}
|
||||
case Opcode::I_INST:
|
||||
switch (func3) {
|
||||
case 0: return func7 ? "SUBI" : "ADDI";
|
||||
case 0: return "ADDI";
|
||||
case 1: return "SLLI";
|
||||
case 2: return "SLTI";
|
||||
case 3: return "SLTIU";
|
||||
|
@ -163,10 +163,10 @@ static const char* op_string(const Instr &instr) {
|
|||
default:
|
||||
std::abort();
|
||||
}
|
||||
case 0x60: return rs2 ? "FCVT.WU" : "FCVT.W";
|
||||
case 0x68: return rs2 ? "FCVT.S" : "FCVT.S";
|
||||
case 0x60: return rs2 ? "FCVT.WU.S" : "FCVT.W.S";
|
||||
case 0x68: return rs2 ? "FCVT.S.WU" : "FCVT.S.W";
|
||||
case 0x70: return func3 ? "FLASS" : "FMV.X.W";
|
||||
case 0x78: return "FMV.W";
|
||||
case 0x78: return "FMV.W.X";
|
||||
default:
|
||||
std::abort();
|
||||
}
|
||||
|
@ -283,11 +283,18 @@ std::shared_ptr<Instr> Decoder::decode(Word code) {
|
|||
|
||||
case InstType::R_TYPE:
|
||||
if (op == Opcode::FCI) {
|
||||
instr->setSrcFReg(rs1);
|
||||
switch (func7) {
|
||||
case 0x68: // FCVT.S.W, FCVT.S.WU
|
||||
case 0x78: // FMV.W.X
|
||||
instr->setSrcReg(rs1);
|
||||
break;
|
||||
default:
|
||||
instr->setSrcFReg(rs1);
|
||||
}
|
||||
instr->setSrcFReg(rs2);
|
||||
switch (func7) {
|
||||
case 0x50: // FLE, FLT, FEQ
|
||||
case 0x60: // FCVT.WU, FCVT.W
|
||||
case 0x60: // FCVT.WU.S, FCVT.W.S
|
||||
case 0x70: // FLASS, FMV.X.W
|
||||
instr->setDestReg(rd);
|
||||
break;
|
||||
|
@ -304,12 +311,11 @@ std::shared_ptr<Instr> Decoder::decode(Word code) {
|
|||
break;
|
||||
|
||||
case InstType::I_TYPE: {
|
||||
if (op == Opcode::FCI || op == Opcode::FL) {
|
||||
instr->setDestFReg(rd);
|
||||
instr->setSrcFReg(rs1);
|
||||
instr->setSrcReg(rs1);
|
||||
if (op == Opcode::FL) {
|
||||
instr->setDestFReg(rd);
|
||||
} else {
|
||||
instr->setDestReg(rd);
|
||||
instr->setSrcReg(rs1);
|
||||
}
|
||||
instr->setFunc3(func3);
|
||||
instr->setFunc7(func7);
|
||||
|
@ -320,12 +326,11 @@ std::shared_ptr<Instr> Decoder::decode(Word code) {
|
|||
}
|
||||
} break;
|
||||
|
||||
case InstType::S_TYPE: {
|
||||
case InstType::S_TYPE: {
|
||||
instr->setSrcReg(rs1);
|
||||
if (op == Opcode::FS) {
|
||||
instr->setSrcFReg(rs1);
|
||||
instr->setSrcFReg(rs2);
|
||||
} else {
|
||||
instr->setSrcReg(rs1);
|
||||
instr->setSrcReg(rs2);
|
||||
}
|
||||
instr->setFunc3(func3);
|
||||
|
|
501
simX/execute.cpp
501
simX/execute.cpp
File diff suppressed because it is too large
Load diff
|
@ -1,9 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
echo start > results.txt
|
||||
|
||||
make
|
||||
printf "Fasten your seatbelts ladies and gentelmen!!\n\n\n\n"
|
||||
#./simX -a rv32i -i ../benchmarks/vector/vecadd/vx_vec_vecadd.hex -s 1> emulator.debug
|
||||
#./simX -a rv32i -i ../benchmarks/vector/saxpy/vx_vec_saxpy.hex -s 1> emulator.debug
|
||||
./simX -a rv32i -i ../benchmarks/vector/sgemm_nn/vx_vec_sgemm_nn.hex -s 1> emulator.debug
|
|
@ -1,142 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
make
|
||||
echo start > results.txt
|
||||
|
||||
echo ./../benchmarks/isa/riscv_tests/rv32ui-p-add.hex >> results.txt
|
||||
./simX -a rv32i -i ../benchmarks/isa/riscv_tests/rv32ui-p-add.hex -s >> results.txt
|
||||
|
||||
echo ./../benchmarks/isa/riscv_tests/rv32ui-p-addi.hex >> results.txt
|
||||
./simX -a rv32i -i ../benchmarks/isa/riscv_tests/rv32ui-p-addi.hex -s >> results.txt
|
||||
|
||||
echo ./../benchmarks/isa/riscv_tests/rv32ui-p-and.hex >> results.txt
|
||||
./simX -a rv32i -i ../benchmarks/isa/riscv_tests/rv32ui-p-and.hex -s >> results.txt
|
||||
|
||||
echo ./../benchmarks/isa/riscv_tests/rv32ui-p-andi.hex >> results.txt
|
||||
./simX -a rv32i -i ../benchmarks/isa/riscv_tests/rv32ui-p-andi.hex -s >> results.txt
|
||||
|
||||
echo ./../benchmarks/isa/riscv_tests/rv32ui-p-auipc.hex >> results.txt
|
||||
./simX -a rv32i -i ../benchmarks/isa/riscv_tests/rv32ui-p-auipc.hex -s >> results.txt
|
||||
|
||||
echo ./../benchmarks/isa/riscv_tests/rv32ui-p-beq.hex >> results.txt
|
||||
./simX -a rv32i -i ../benchmarks/isa/riscv_tests/rv32ui-p-beq.hex -s >> results.txt
|
||||
|
||||
echo ./../benchmarks/isa/riscv_tests/rv32ui-p-bge.hex >> results.txt
|
||||
./simX -a rv32i -i ../benchmarks/isa/riscv_tests/rv32ui-p-bge.hex -s >> results.txt
|
||||
|
||||
echo ./../benchmarks/isa/riscv_tests/rv32ui-p-bgeu.hex >> results.txt
|
||||
./simX -a rv32i -i ../benchmarks/isa/riscv_tests/rv32ui-p-bgeu.hex -s >> results.txt
|
||||
|
||||
echo ./../benchmarks/isa/riscv_tests/rv32ui-p-blt.hex >> results.txt
|
||||
./simX -a rv32i -i ../benchmarks/isa/riscv_tests/rv32ui-p-blt.hex -s >> results.txt
|
||||
|
||||
echo ./../benchmarks/isa/riscv_tests/rv32ui-p-bltu.hex >> results.txt
|
||||
./simX -a rv32i -i ../benchmarks/isa/riscv_tests/rv32ui-p-bltu.hex -s >> results.txt
|
||||
|
||||
echo ./../benchmarks/isa/riscv_tests/rv32ui-p-bne.hex >> results.txt
|
||||
./simX -a rv32i -i ../benchmarks/isa/riscv_tests/rv32ui-p-bne.hex -s >> results.txt
|
||||
|
||||
echo ./../benchmarks/isa/riscv_tests/rv32ui-p-jal.hex >> results.txt
|
||||
./simX -a rv32i -i ../benchmarks/isa/riscv_tests/rv32ui-p-jal.hex -s >> results.txt
|
||||
|
||||
echo ./../benchmarks/isa/riscv_tests/rv32ui-p-jalr.hex >> results.txt
|
||||
./simX -a rv32i -i ../benchmarks/isa/riscv_tests/rv32ui-p-jalr.hex -s >> results.txt
|
||||
|
||||
echo ./../benchmarks/isa/riscv_tests/rv32ui-p-lb.hex >> results.txt
|
||||
./simX -a rv32i -i ../benchmarks/isa/riscv_tests/rv32ui-p-lb.hex -s >> results.txt
|
||||
|
||||
echo ./../benchmarks/isa/riscv_tests/rv32ui-p-lbu.hex >> results.txt
|
||||
./simX -a rv32i -i ../benchmarks/isa/riscv_tests/rv32ui-p-lbu.hex -s >> results.txt
|
||||
|
||||
echo ./../benchmarks/isa/riscv_tests/rv32ui-p-lh.hex >> results.txt
|
||||
./simX -a rv32i -i ../benchmarks/isa/riscv_tests/rv32ui-p-lh.hex -s >> results.txt
|
||||
|
||||
echo ./../benchmarks/isa/riscv_tests/rv32ui-p-lhu.hex >> results.txt
|
||||
./simX -a rv32i -i ../benchmarks/isa/riscv_tests/rv32ui-p-lhu.hex -s >> results.txt
|
||||
|
||||
echo ./../benchmarks/isa/riscv_tests/rv32ui-p-lui.hex >> results.txt
|
||||
./simX -a rv32i -i ../benchmarks/isa/riscv_tests/rv32ui-p-lui.hex -s >> results.txt
|
||||
|
||||
echo ./../benchmarks/isa/riscv_tests/rv32ui-p-lw.hex >> results.txt
|
||||
./simX -a rv32i -i ../benchmarks/isa/riscv_tests/rv32ui-p-lw.hex -s >> results.txt
|
||||
|
||||
echo ./../benchmarks/isa/riscv_tests/rv32ui-p-or.hex >> results.txt
|
||||
./simX -a rv32i -i ../benchmarks/isa/riscv_tests/rv32ui-p-or.hex -s >> results.txt
|
||||
|
||||
echo ./../benchmarks/isa/riscv_tests/rv32ui-p-ori.hex >> results.txt
|
||||
./simX -a rv32i -i ../benchmarks/isa/riscv_tests/rv32ui-p-ori.hex -s >> results.txt
|
||||
|
||||
echo ./../benchmarks/isa/riscv_tests/rv32ui-p-sb.hex >> results.txt
|
||||
./simX -a rv32i -i ../benchmarks/isa/riscv_tests/rv32ui-p-sb.hex -s >> results.txt
|
||||
|
||||
echo ./../benchmarks/isa/riscv_tests/rv32ui-p-sh.hex >> results.txt
|
||||
./simX -a rv32i -i ../benchmarks/isa/riscv_tests/rv32ui-p-sh.hex -s >> results.txt
|
||||
|
||||
echo ./../benchmarks/isa/riscv_tests/rv32ui-p-simple.hex >> results.txt
|
||||
./simX -a rv32i -i ../benchmarks/isa/riscv_tests/rv32ui-p-simple.hex -s >> results.txt
|
||||
|
||||
echo ./../benchmarks/isa/riscv_tests/rv32ui-p-sll.hex >> results.txt
|
||||
./simX -a rv32i -i ../benchmarks/isa/riscv_tests/rv32ui-p-sll.hex -s >> results.txt
|
||||
|
||||
echo ./../benchmarks/isa/riscv_tests/rv32ui-p-slli.hex >> results.txt
|
||||
./simX -a rv32i -i ../benchmarks/isa/riscv_tests/rv32ui-p-slli.hex -s >> results.txt
|
||||
|
||||
echo ./../benchmarks/isa/riscv_tests/rv32ui-p-slt.hex >> results.txt
|
||||
./simX -a rv32i -i ../benchmarks/isa/riscv_tests/rv32ui-p-slt.hex -s >> results.txt
|
||||
|
||||
echo ./../benchmarks/isa/riscv_tests/rv32ui-p-slti.hex >> results.txt
|
||||
./simX -a rv32i -i ../benchmarks/isa/riscv_tests/rv32ui-p-slti.hex -s >> results.txt
|
||||
|
||||
echo ./../benchmarks/isa/riscv_tests/rv32ui-p-sltiu.hex >> results.txt
|
||||
./simX -a rv32i -i ../benchmarks/isa/riscv_tests/rv32ui-p-sltiu.hex -s >> results.txt
|
||||
|
||||
echo ./../benchmarks/isa/riscv_tests/rv32ui-p-sltu.hex >> results.txt
|
||||
./simX -a rv32i -i ../benchmarks/isa/riscv_tests/rv32ui-p-sltu.hex -s >> results.txt
|
||||
|
||||
echo ./../benchmarks/isa/riscv_tests/rv32ui-p-sra.hex >> results.txt
|
||||
./simX -a rv32i -i ../benchmarks/isa/riscv_tests/rv32ui-p-sra.hex -s >> results.txt
|
||||
|
||||
echo ./../benchmarks/isa/riscv_tests/rv32ui-p-srai.hex >> results.txt
|
||||
./simX -a rv32i -i ../benchmarks/isa/riscv_tests/rv32ui-p-srai.hex -s >> results.txt
|
||||
|
||||
echo ./../benchmarks/isa/riscv_tests/rv32ui-p-srl.hex >> results.txt
|
||||
./simX -a rv32i -i ../benchmarks/isa/riscv_tests/rv32ui-p-srl.hex -s >> results.txt
|
||||
|
||||
echo ./../benchmarks/isa/riscv_tests/rv32ui-p-srli.hex >> results.txt
|
||||
./simX -a rv32i -i ../benchmarks/isa/riscv_tests/rv32ui-p-srli.hex -s >> results.txt
|
||||
|
||||
echo ./../benchmarks/isa/riscv_tests/rv32ui-p-sub.hex >> results.txt
|
||||
./simX -a rv32i -i ../benchmarks/isa/riscv_tests/rv32ui-p-sub.hex -s >> results.txt
|
||||
|
||||
echo ./../benchmarks/isa/riscv_tests/rv32ui-p-sw.hex >> results.txt
|
||||
./simX -a rv32i -i ../benchmarks/isa/riscv_tests/rv32ui-p-sw.hex -s >> results.txt
|
||||
|
||||
echo ./../benchmarks/isa/riscv_tests/rv32ui-p-xor.hex >> results.txt
|
||||
./simX -a rv32i -i ../benchmarks/isa/riscv_tests/rv32ui-p-xor.hex -s >> results.txt
|
||||
|
||||
echo ./../benchmarks/isa/riscv_tests/rv32ui-p-xori.hex >> results.txt
|
||||
./simX -a rv32i -i ../benchmarks/isa/riscv_tests/rv32ui-p-xori.hex -s >> results.txt
|
||||
|
||||
# echo ./../benchmarks/isa/riscv_tests/rv32um-p-div.hex >> results.txt
|
||||
# ./simX -a rv32i -i ../benchmarks/isa/riscv_tests/rv32um-p-div.hex -s >> results.txt
|
||||
|
||||
# echo ./../benchmarks/isa/riscv_tests/rv32um-p-divu.hex >> results.txt
|
||||
# ./simX -a rv32i -i ../benchmarks/isa/riscv_tests/rv32um-p-divu.hex -s >> results.txt
|
||||
|
||||
# echo ./../benchmarks/isa/riscv_tests/rv32um-p-mul.hex >> results.txt
|
||||
# ./simX -a rv32i -i ../benchmarks/isa/riscv_tests/rv32um-p-mul.hex -s >> results.txt
|
||||
|
||||
# echo ./../benchmarks/isa/riscv_tests/rv32um-p-mulh.hex >> results.txt
|
||||
# ./simX -a rv32i -i ../benchmarks/isa/riscv_tests/rv32um-p-mulh.hex -s >> results.txt
|
||||
|
||||
# echo ./../benchmarks/isa/riscv_tests/rv32um-p-mulhsu.hex >> results.txt
|
||||
# ./simX -a rv32i -i ../benchmarks/isa/riscv_tests/rv32um-p-mulhsu.hex -s >> results.txt
|
||||
|
||||
# echo ./../benchmarks/isa/riscv_tests/rv32um-p-mulhu.hex >> results.txt
|
||||
# ./simX -a rv32i -i ../benchmarks/isa/riscv_tests/rv32um-p-mulhu.hex -s >> results.txt
|
||||
|
||||
# echo ./../benchmarks/isa/riscv_tests/rv32um-p-rem.hex >> results.txt
|
||||
# ./simX -a rv32i -i ../benchmarks/isa/riscv_tests/rv32um-p-rem.hex -s >> results.txt
|
||||
|
||||
# echo ./../benchmarks/isa/riscv_tests/rv32um-p-remu.hex >> results.txt
|
||||
# ./simX -a rv32i -i ../benchmarks/isa/riscv_tests/rv32um-p-remu.hex -s >> results.txt
|
|
@ -1,8 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
echo start > results.txt
|
||||
|
||||
# echo ../kernel/vortex_test.hex
|
||||
make
|
||||
printf "Fasten your seatbelts ladies and gentelmen!!\n\n\n\n"
|
||||
./Vcache_simX -a rv32i -i ../rvvector/basic/vx_vector_main.hex -s 1> emulator.debug
|
45
simX/trace.h
45
simX/trace.h
|
@ -1,45 +0,0 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
namespace vortex {
|
||||
|
||||
struct trace_inst_t {
|
||||
// Warp step
|
||||
bool valid;
|
||||
unsigned PC;
|
||||
|
||||
// Core scheduler
|
||||
int wid;
|
||||
|
||||
// Encoder
|
||||
int irs1;
|
||||
int irs2;
|
||||
int ird;
|
||||
|
||||
// Floating-point
|
||||
int frs1;
|
||||
int frs2;
|
||||
int frs3;
|
||||
int frd;
|
||||
|
||||
// Vector extension
|
||||
int vrs1;
|
||||
int vrs2;
|
||||
int vrd;
|
||||
|
||||
// Instruction execute
|
||||
bool is_lw;
|
||||
bool is_sw;
|
||||
unsigned * mem_addresses;
|
||||
|
||||
// dmem interface
|
||||
unsigned long mem_stall_cycles;
|
||||
unsigned long fetch_stall_cycles;
|
||||
|
||||
// Instruction execute
|
||||
bool stall_warp;
|
||||
bool wspawn;
|
||||
|
||||
bool stalled;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue