Commit dada75d4 authored by Tristan Gingold's avatar Tristan Gingold

urv_fetch.v: add g_with_hw_debug parameter to optimize code

parent 8d8f369a
...@@ -172,6 +172,7 @@ module urv_cpu ...@@ -172,6 +172,7 @@ module urv_cpu
urv_fetch urv_fetch
#( #(
.g_with_hw_debug(g_with_hw_debug),
.g_with_compressed_insns(g_with_compressed_insns) .g_with_compressed_insns(g_with_compressed_insns)
) )
fetch fetch
...@@ -267,7 +268,9 @@ module urv_cpu ...@@ -267,7 +268,9 @@ module urv_cpu
// Register File (RF) // Register File (RF)
urv_regfile urv_regfile
#(.g_with_ecc(g_with_ecc)) #(
.g_with_ecc(g_with_ecc)
)
regfile regfile
( (
.clk_i(clk_i), .clk_i(clk_i),
......
...@@ -59,6 +59,7 @@ module urv_fetch ...@@ -59,6 +59,7 @@ module urv_fetch
); );
parameter g_with_compressed_insns = 0; parameter g_with_compressed_insns = 0;
parameter g_with_hw_debug = 0;
reg [31:0] pc; reg [31:0] pc;
reg rst_d; reg rst_d;
...@@ -120,7 +121,8 @@ module urv_fetch ...@@ -120,7 +121,8 @@ module urv_fetch
f_pc_o <= pc; f_pc_o <= pc;
pc <= pc_next; pc <= pc_next;
if(!dbg_mode if(g_with_hw_debug
&& !dbg_mode
&& (dbg_force_i || x_dbg_toggle_i || pipeline_cnt != 0)) && (dbg_force_i || x_dbg_toggle_i || pipeline_cnt != 0))
begin begin
// Enter or entering in debug mode // Enter or entering in debug mode
...@@ -137,7 +139,7 @@ module urv_fetch ...@@ -137,7 +139,7 @@ module urv_fetch
else else
pipeline_cnt <= pipeline_cnt + 1'b1; pipeline_cnt <= pipeline_cnt + 1'b1;
end end
else if(dbg_mode) else if(g_with_hw_debug && dbg_mode)
begin begin
// In debug mode // In debug mode
if (x_dbg_toggle_i) if (x_dbg_toggle_i)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment