Skip to content

Commit

Permalink
[rtl] IO: use termination record for rsp bus reset
Browse files Browse the repository at this point in the history
  • Loading branch information
stnolting committed Jun 30, 2024
1 parent 24ab047 commit 297466f
Show file tree
Hide file tree
Showing 20 changed files with 74 additions and 119 deletions.
13 changes: 5 additions & 8 deletions rtl/core/neorv32_cfs.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,11 @@ begin
bus_access: process(rstn_i, clk_i)
begin
if (rstn_i = '0') then
cfs_reg_wr(0) <= (others => '0');
cfs_reg_wr(1) <= (others => '0');
cfs_reg_wr(2) <= (others => '0');
cfs_reg_wr(3) <= (others => '0');
--
bus_rsp_o.ack <= '0';
bus_rsp_o.err <= '0';
bus_rsp_o.data <= (others => '0');
cfs_reg_wr(0) <= (others => '0');
cfs_reg_wr(1) <= (others => '0');
cfs_reg_wr(2) <= (others => '0');
cfs_reg_wr(3) <= (others => '0');
bus_rsp_o <= rsp_terminate_c;
elsif rising_edge(clk_i) then -- synchronous interface for read and write accesses
-- transfer/access acknowledge --
bus_rsp_o.ack <= bus_req_i.stb;
Expand Down
12 changes: 5 additions & 7 deletions rtl/core/neorv32_crc.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,11 @@ begin
bus_access: process(rstn_i, clk_i)
begin
if (rstn_i = '0') then
bus_rsp_o.ack <= '0';
bus_rsp_o.err <= '0';
bus_rsp_o.data <= (others => '0');
crc.mode <= (others => '0');
crc.poly <= (others => '0');
crc.data <= (others => '0');
we_ack <= (others => '0');
bus_rsp_o <= rsp_terminate_c;
crc.mode <= (others => '0');
crc.poly <= (others => '0');
crc.data <= (others => '0');
we_ack <= (others => '0');
elsif rising_edge(clk_i) then
-- bus handshake --
bus_rsp_o.data <= (others => '0');
Expand Down
4 changes: 1 addition & 3 deletions rtl/core/neorv32_debug_dm.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -641,9 +641,7 @@ begin
bus_access: process(rstn_i, clk_i)
begin
if (rstn_i = '0') then
bus_rsp_o.ack <= '0';
bus_rsp_o.err <= '0';
bus_rsp_o.data <= (others => '0');
bus_rsp_o <= rsp_terminate_c;
dci.data_reg <= (others => '0');
dci.halt_ack <= '0';
dci.resume_ack <= '0';
Expand Down
4 changes: 1 addition & 3 deletions rtl/core/neorv32_dma.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,7 @@ begin
bus_access: process(rstn_i, clk_i)
begin
if (rstn_i = '0') then
bus_rsp_o.ack <= '0';
bus_rsp_o.err <= '0';
bus_rsp_o.data <= (others => '0');
bus_rsp_o <= rsp_terminate_c;
config.enable <= '0';
config.auto <= '0';
config.fence <= '0';
Expand Down
6 changes: 2 additions & 4 deletions rtl/core/neorv32_gpio.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,8 @@ begin
bus_access: process(rstn_i, clk_i)
begin
if (rstn_i = '0') then
bus_rsp_o.ack <= '0';
bus_rsp_o.err <= '0';
bus_rsp_o.data <= (others => '0');
dout <= (others => '0');
bus_rsp_o <= rsp_terminate_c;
dout <= (others => '0');
elsif rising_edge(clk_i) then
-- bus handshake --
bus_rsp_o.ack <= bus_req_i.stb;
Expand Down
14 changes: 6 additions & 8 deletions rtl/core/neorv32_gptmr.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,12 @@ begin
bus_access: process(rstn_i, clk_i)
begin
if (rstn_i = '0') then
bus_rsp_o.ack <= '0';
bus_rsp_o.err <= '0';
bus_rsp_o.data <= (others => '0');
ctrl <= (others => '0');
trig_match <= '0';
trig_capture <= '0';
timer.cnt_we <= '0';
timer.thres <= (others => '0');
bus_rsp_o <= rsp_terminate_c;
ctrl <= (others => '0');
trig_match <= '0';
trig_capture <= '0';
timer.cnt_we <= '0';
timer.thres <= (others => '0');
elsif rising_edge(clk_i) then
-- defaults --
bus_rsp_o.ack <= bus_req_i.stb;
Expand Down
17 changes: 7 additions & 10 deletions rtl/core/neorv32_mtime.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,13 @@ begin
bus_access: process(rstn_i, clk_i)
begin
if (rstn_i = '0') then
mtimecmp_lo <= (others => '0');
mtimecmp_hi <= (others => '0');
mtime_we <= (others => '0');
mtime_lo <= (others => '0');
mtime_lo_cry <= (others => '0');
mtime_hi <= (others => '0');
--
bus_rsp_o.ack <= '0';
bus_rsp_o.err <= '0';
bus_rsp_o.data <= (others => '0');
mtimecmp_lo <= (others => '0');
mtimecmp_hi <= (others => '0');
mtime_we <= (others => '0');
mtime_lo <= (others => '0');
mtime_lo_cry <= (others => '0');
mtime_hi <= (others => '0');
bus_rsp_o <= rsp_terminate_c;
elsif rising_edge(clk_i) then
-- mtimecmp --
if (bus_req_i.stb = '1') and (bus_req_i.rw = '1') and (bus_req_i.addr(3) = '1') then
Expand Down
21 changes: 9 additions & 12 deletions rtl/core/neorv32_neoled.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -123,18 +123,15 @@ begin
bus_access: process(rstn_i, clk_i)
begin
if (rstn_i = '0') then
ctrl.enable <= '0';
ctrl.mode <= '0';
ctrl.strobe <= '0';
ctrl.clk_prsc <= (others => '0');
ctrl.irq_conf <= '0';
ctrl.t_total <= (others => '0');
ctrl.t0_high <= (others => '0');
ctrl.t1_high <= (others => '0');
--
bus_rsp_o.ack <= '0';
bus_rsp_o.err <= '0';
bus_rsp_o.data <= (others => '0');
ctrl.enable <= '0';
ctrl.mode <= '0';
ctrl.strobe <= '0';
ctrl.clk_prsc <= (others => '0');
ctrl.irq_conf <= '0';
ctrl.t_total <= (others => '0');
ctrl.t0_high <= (others => '0');
ctrl.t1_high <= (others => '0');
bus_rsp_o <= rsp_terminate_c;
elsif rising_edge(clk_i) then
-- bus handshake --
bus_rsp_o.ack <= bus_req_i.stb;
Expand Down
4 changes: 1 addition & 3 deletions rtl/core/neorv32_onewire.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,7 @@ begin
bus_access: process(rstn_i, clk_i)
begin
if (rstn_i = '0') then
bus_rsp_o.ack <= '0';
bus_rsp_o.err <= '0';
bus_rsp_o.data <= (others => '0');
bus_rsp_o <= rsp_terminate_c;
ctrl.enable <= '0';
ctrl.clk_prsc <= (others => '0');
ctrl.clk_div <= (others => '0');
Expand Down
10 changes: 4 additions & 6 deletions rtl/core/neorv32_pwm.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,10 @@ begin
bus_access: process(rstn_i, clk_i)
begin
if (rstn_i = '0') then
bus_rsp_o.ack <= '0';
bus_rsp_o.err <= '0';
bus_rsp_o.data <= (others => '0');
enable <= '0';
prsc <= (others => '0');
pwm_ch <= (others => (others => '0'));
bus_rsp_o <= rsp_terminate_c;
enable <= '0';
prsc <= (others => '0');
pwm_ch <= (others => (others => '0'));
elsif rising_edge(clk_i) then
-- bus handshake --
bus_rsp_o.ack <= bus_req_i.stb;
Expand Down
4 changes: 1 addition & 3 deletions rtl/core/neorv32_sdi.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,7 @@ begin
bus_access: process(rstn_i, clk_i)
begin
if (rstn_i = '0') then
bus_rsp_o.ack <= '0';
bus_rsp_o.err <= '0';
bus_rsp_o.data <= (others => '0');
bus_rsp_o <= rsp_terminate_c;
ctrl.enable <= '0';
ctrl.clr_rx <= '0';
ctrl.irq_rx_avail <= '0';
Expand Down
4 changes: 1 addition & 3 deletions rtl/core/neorv32_slink.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,7 @@ begin
bus_access: process(rstn_i, clk_i)
begin
if (rstn_i = '0') then
bus_rsp_o.ack <= '0';
bus_rsp_o.err <= '0';
bus_rsp_o.data <= (others => '0');
bus_rsp_o <= rsp_terminate_c;
ctrl.enable <= '0';
ctrl.rx_clr <= '0';
ctrl.tx_clr <= '0';
Expand Down
4 changes: 1 addition & 3 deletions rtl/core/neorv32_spi.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,7 @@ begin
bus_access: process(rstn_i, clk_i)
begin
if (rstn_i = '0') then
bus_rsp_o.ack <= '0';
bus_rsp_o.err <= '0';
bus_rsp_o.data <= (others => '0');
bus_rsp_o <= rsp_terminate_c;
ctrl.enable <= '0';
ctrl.cpha <= '0';
ctrl.cpol <= '0';
Expand Down
8 changes: 2 additions & 6 deletions rtl/core/neorv32_sysinfo.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,9 @@ begin
bus_access: process(rstn_i, clk_i)
begin
if (rstn_i = '0') then
bus_rsp_o.ack <= '0';
bus_rsp_o.err <= '0';
bus_rsp_o.data <= (others => '0');
bus_rsp_o <= rsp_terminate_c;
elsif rising_edge(clk_i) then
bus_rsp_o.ack <= '0';
bus_rsp_o.err <= '0';
bus_rsp_o.data <= (others => '0');
bus_rsp_o <= rsp_terminate_c; -- default
if (bus_req_i.stb = '1') and (bus_req_i.rw = '0') then -- read-only
bus_rsp_o.ack <= '1';
bus_rsp_o.data <= sysinfo(to_integer(unsigned(bus_req_i.addr(3 downto 2))));
Expand Down
10 changes: 4 additions & 6 deletions rtl/core/neorv32_trng.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,10 @@ begin
bus_access: process(rstn_i, clk_i)
begin
if (rstn_i = '0') then
bus_rsp_o.ack <= '0';
bus_rsp_o.err <= '0';
bus_rsp_o.data <= (others => '0');
fifo_clr <= '0';
irq_sel <= '0';
enable <= '0';
bus_rsp_o <= rsp_terminate_c;
fifo_clr <= '0';
irq_sel <= '0';
enable <= '0';
elsif rising_edge(clk_i) then
-- defaults --
bus_rsp_o.ack <= bus_req_i.stb;
Expand Down
10 changes: 4 additions & 6 deletions rtl/core/neorv32_twi.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,10 @@ begin
bus_access: process(rstn_i, clk_i)
begin
if (rstn_i = '0') then
bus_rsp_o.ack <= '0';
bus_rsp_o.err <= '0';
bus_rsp_o.data <= (others => '0');
ctrl.enable <= '0';
ctrl.prsc <= (others => '0');
ctrl.cdiv <= (others => '0');
bus_rsp_o <= rsp_terminate_c;
ctrl.enable <= '0';
ctrl.prsc <= (others => '0');
ctrl.cdiv <= (others => '0');
elsif rising_edge(clk_i) then
-- bus handshake defaults --
bus_rsp_o.ack <= bus_req_i.stb;
Expand Down
4 changes: 1 addition & 3 deletions rtl/core/neorv32_uart.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,7 @@ begin
bus_access: process(rstn_i, clk_i)
begin
if (rstn_i = '0') then
bus_rsp_o.ack <= '0';
bus_rsp_o.err <= '0';
bus_rsp_o.data <= (others => '0');
bus_rsp_o <= rsp_terminate_c;
ctrl.enable <= '0';
ctrl.sim_mode <= '0';
ctrl.hwfc_en <= '0';
Expand Down
20 changes: 9 additions & 11 deletions rtl/core/neorv32_wdt.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -79,17 +79,15 @@ begin
bus_access: process(rstn_i, clk_i)
begin
if (rstn_i = '0') then
bus_rsp_o.ack <= '0';
bus_rsp_o.err <= '0';
bus_rsp_o.data <= (others => '0');
ctrl.enable <= '0'; -- disable WDT after reset
ctrl.lock <= '0'; -- unlock after reset
ctrl.dben <= '0';
ctrl.sen <= '0';
ctrl.strict <= '0';
ctrl.timeout <= (others => '0');
reset_wdt <= '0';
reset_force <= '0';
bus_rsp_o <= rsp_terminate_c;
ctrl.enable <= '0'; -- disable WDT after reset
ctrl.lock <= '0'; -- unlock after reset
ctrl.dben <= '0';
ctrl.sen <= '0';
ctrl.strict <= '0';
ctrl.timeout <= (others => '0');
reset_wdt <= '0';
reset_force <= '0';
elsif rising_edge(clk_i) then
-- bus handshake --
bus_rsp_o.ack <= bus_req_i.stb;
Expand Down
12 changes: 5 additions & 7 deletions rtl/core/neorv32_xip.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,11 @@ begin
ctrl_bus_access : process(rstn_i, clk_i)
begin
if (rstn_i = '0') then
bus_rsp_o.ack <= '0';
bus_rsp_o.err <= '0';
bus_rsp_o.data <= (others => '0');
ctrl <= (others => '0');
spi_data_lo <= (others => '0');
spi_data_hi <= (others => '0');
spi_trigger <= '0';
bus_rsp_o <= rsp_terminate_c;
ctrl <= (others => '0');
spi_data_lo <= (others => '0');
spi_data_hi <= (others => '0');
spi_trigger <= '0';
elsif rising_edge(clk_i) then
-- bus handshake --
bus_rsp_o.ack <= bus_req_i.stb;
Expand Down
12 changes: 5 additions & 7 deletions rtl/core/neorv32_xirq.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,11 @@ begin
bus_access: process(rstn_i, clk_i)
begin
if (rstn_i = '0') then
bus_rsp_o.ack <= '0';
bus_rsp_o.err <= '0';
bus_rsp_o.data <= (others => '0');
nclr_pending <= (others => '0');
irq_type <= (others => '0');
irq_polarity <= (others => '0');
irq_enable <= (others => '0');
bus_rsp_o <= rsp_terminate_c;
nclr_pending <= (others => '0');
irq_type <= (others => '0');
irq_polarity <= (others => '0');
irq_enable <= (others => '0');
elsif rising_edge(clk_i) then
-- defaults --
bus_rsp_o.ack <= bus_req_i.stb;
Expand Down

0 comments on commit 297466f

Please sign in to comment.