Skip to content

Commit

Permalink
Moved FSM state definition before jinja if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
stdefeber committed Aug 14, 2024
1 parent 10ad9bb commit 33963a2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions corsair/templates/wb2lb_verilog.j2
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ module {{ module_name }} #(
output [DATA_W-1:0] wb_dat_o,
output wb_ack_o
);
{% if regmap_embed %}


reg [1:0] c_state;
parameter s_idle=0, s_write=1, s_read=2;

{% if regmap_embed %}

wire wready;
wire [ADDR_W-1:0] waddr;
wire [DATA_W-1:0] wdata;
Expand Down
5 changes: 3 additions & 2 deletions corsair/templates/wb2lb_vhdl.j2
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,13 @@ port(
);
end {{ module_name }};
architecture arch_imp of {{ module_name }} is
{% macro wb_signals(regmap_embed=False) %}
{% if regmap_embed %}

type fsm_states is (s_idle, s_write, s_read);
signal c_state : fsm_states;

{% macro wb_signals(regmap_embed=False) %}
{% if regmap_embed %}

signal wready : std_logic;
signal waddr : std_logic_vector(ADDR_W-1 downto 0);
signal wdata : std_logic_vector(DATA_W-1 downto 0);
Expand Down

0 comments on commit 33963a2

Please sign in to comment.