From b7da6e5c201ce7ca29c87305ae41326b8a817186 Mon Sep 17 00:00:00 2001 From: Andrei Solodovnikov Date: Wed, 18 Oct 2023 17:41:49 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=B4=D0=B5=D0=BA=D0=BE=D0=B4=D0=B5=D1=80?= =?UTF-8?q?=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit В связи со способом генерации инструкций, за отведенное время тб не генерировал инструкции сдвига, что вело к не совсем полному покрытию. --- Labs/05. Main decoder/tb_decoder_riscv.sv | 1389 ++++++++++++--------- 1 file changed, 784 insertions(+), 605 deletions(-) diff --git a/Labs/05. Main decoder/tb_decoder_riscv.sv b/Labs/05. Main decoder/tb_decoder_riscv.sv index a141fb8e..e5811065 100644 --- a/Labs/05. Main decoder/tb_decoder_riscv.sv +++ b/Labs/05. Main decoder/tb_decoder_riscv.sv @@ -116,6 +116,7 @@ module tb_decoder_riscv(); jal_miss = 'b0; jalr_miss = 'b0; mret_miss = 'b0; + illegal_miss = grm.illegal_instr_o !== illegal_instr; case (opcode) LOAD_OPCODE, STORE_OPCODE: begin @@ -128,7 +129,6 @@ module tb_decoder_riscv(); mem_size_miss = (grm.mem_size_o !== mem_size) & !illegal_instr; gpr_we_miss = grm.gpr_we_o !== gpr_we; wb_sel_miss = (grm.wb_sel_o !== wb_sel) & !illegal_instr; - illegal_miss = grm.illegal_instr_o !== illegal_instr; branch_miss = grm.branch_o !== branch; jal_miss = grm.jal_o !== jal; jalr_miss = grm.jalr_o !== jalr; @@ -148,7 +148,6 @@ module tb_decoder_riscv(); //mem_size_miss = (grm.mem_size_o !== mem_size) & !illegal_instr; gpr_we_miss = grm.gpr_we_o !== gpr_we; wb_sel_miss = (grm.wb_sel_o !== wb_sel) & !illegal_instr; - illegal_miss = grm.illegal_instr_o !== illegal_instr; branch_miss = grm.branch_o !== branch; jal_miss = grm.jal_o !== jal; jalr_miss = grm.jalr_o !== jalr; @@ -166,7 +165,6 @@ module tb_decoder_riscv(); //mem_size_miss = (grm.mem_size_o !== mem_size) & !illegal_instr; gpr_we_miss = grm.gpr_we_o !== gpr_we; //wb_sel_miss = (grm.wb_sel_o !== wb_sel) & !illegal_instr; - illegal_miss = grm.illegal_instr_o !== illegal_instr; branch_miss = grm.branch_o !== branch; jal_miss = grm.jal_o !== jal; jalr_miss = grm.jalr_o !== jalr; @@ -183,16 +181,28 @@ module tb_decoder_riscv(); //mem_size_miss = (grm.mem_size_o !== mem_size) & !illegal_instr; gpr_we_miss = grm.gpr_we_o !== gpr_we; wb_sel_miss = (grm.wb_sel_o !== wb_sel) & !illegal_instr; - illegal_miss = grm.illegal_instr_o !== illegal_instr; branch_miss = grm.branch_o !== branch; jal_miss = grm.jal_o !== jal; jalr_miss = grm.jalr_o !== jalr; mret_miss = grm.mret_o !== mret; end - SYSTEM_OPCODE: csr_op_miss = (grm.csr_op_o !== csr_op); - - default: //MISC_MEM_OPCODE, SYSTEM_OPCODE and other + SYSTEM_OPCODE: begin + //a_sel_miss = (grm.a_sel_o !== a_sel) & !illegal_instr; + //b_sel_miss = (grm.b_sel_o !== b_sel) & !illegal_instr; + //alu_op_miss = ((alu_op !== ALU_ADD)&(alu_op !== ALU_XOR)&(alu_op !== ALU_OR)) & !illegal_instr; + csr_we_miss = (grm.csr_we_o !== csr_we); + mem_req_miss = grm.mem_req_o !== mem_req; + mem_we_miss = grm.mem_we_o !== mem_we; + //mem_size_miss = (grm.mem_size_o !== mem_size) & !illegal_instr; + gpr_we_miss = grm.gpr_we_o !== gpr_we; + wb_sel_miss = (grm.wb_sel_o !== wb_sel) & !illegal_instr & !mret; + branch_miss = grm.branch_o !== branch; + jal_miss = grm.jal_o !== jal; + jalr_miss = grm.jalr_o !== jalr; + mret_miss = grm.mret_o !== mret; + end + default: //MISC_MEM_OPCODE and other begin //a_sel_miss = grm.a_sel_o !== a_sel; //b_sel_miss = grm.b_sel_o !== b_sel; @@ -203,7 +213,6 @@ module tb_decoder_riscv(); //mem_size_miss = grm.mem_size_o !== mem_size; gpr_we_miss = grm.gpr_we_o !== gpr_we; //wb_sel_miss = grm.wb_sel_o !== wb_sel; - illegal_miss = grm.illegal_instr_o !== illegal_instr; branch_miss = grm.branch_o !== branch; jal_miss = grm.jal_o !== jal; jalr_miss = grm.jalr_o !== jalr; @@ -212,7 +221,7 @@ module tb_decoder_riscv(); endcase end - reg [4:0] X; + integer X; reg [$clog2(cycle+1)-1:0] V; integer error; @@ -224,20 +233,20 @@ module tb_decoder_riscv(); initial begin $display( "\nStart test: \n\n==========================\nCLICK THE BUTTON 'Run All'\n==========================\n"); $stop(); - for (V=0; V