diff options
author | Kimplul <kimi.h.kuparinen@gmail.com> | 2025-02-16 20:55:24 +0200 |
---|---|---|
committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2025-02-16 20:55:24 +0200 |
commit | 82dec45fd786831f791b17b84aedb4d99b5ca25d (patch) | |
tree | 5b98b452edc749b938a67368c9020244ca40595e /tb/rv2insn_tb.sv | |
parent | 0141d830f3326594f159c627dbbc284fdef27674 (diff) | |
download | ttarv32-82dec45fd786831f791b17b84aedb4d99b5ca25d.tar.gz ttarv32-82dec45fd786831f791b17b84aedb4d99b5ca25d.zip |
add initial risc-v -> tta translation block
Diffstat (limited to 'tb/rv2insn_tb.sv')
-rw-r--r-- | tb/rv2insn_tb.sv | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/tb/rv2insn_tb.sv b/tb/rv2insn_tb.sv new file mode 100644 index 0000000..14a0249 --- /dev/null +++ b/tb/rv2insn_tb.sv @@ -0,0 +1,42 @@ +`include "common.svh" + +module rv2insn_tb; + +logic clk; +logic rst_n; + +xlen_t pc; +logic[7:0] rv[4*4]; +insn_t[3:0] que; + +function automatic rv_t[3:0] unp2p(logic[7:0] in[4*4]); + logic [15:0][7:0] conversion; + for (int i = 0; i < 4 * 4; ++i) begin + conversion[i] = in[i]; + end + return conversion; +endfunction + +rv2insn #( + .QUE_DEPTH(4), + .ALU_COUNT(2) +) rv2insn ( + .clk_i(clk), + .rst_ni(rst_n), + .pc_i(pc), + .rv_i(unp2p(rv)), + .que_o(que) +); + +initial begin + $dumpfile("rv2insn_tb.vcd"); + $dumpvars(); + $readmemh("rv2insn.hex", rv); + + clk = 0; + rst_n = 0; + + #10 rst_n = 1; + #10 $finish; +end +endmodule |