Skip to content

Commit

Permalink
[top] add WDT and OCD reset outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
stnolting committed Jan 11, 2025
1 parent 265e333 commit e1339fb
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
2 changes: 2 additions & 0 deletions docs/datasheet/soc.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ to all inputs and output so the synthesis tool can insert an explicit IO (bounda
5+^| **Global Control (<<_processor_clocking>> and <<_processor_reset>>)**
| `clk_i` | 1 | in | none | global clock line, all registers triggering on rising edge
| `rstn_i` | 1 | in | none | global reset, asynchronous, **low-active**
| `rstn_ocd_o` | 1 | out | none | <<_watchdog_timer_wdt>> reset output, synchronous, **low-active**
| `rstn_wdt_o` | 1 | out | none | <<_on_chip_debugger_ocd>> reset output, synchronous, **low-active**
5+^| **JTAG Access Port for <<_on_chip_debugger_ocd>>**
| `jtag_tck_i` | 1 | in | `'L'` | serial clock
| `jtag_tdi_i` | 1 | in | `'L'` | serial data input
Expand Down
4 changes: 3 additions & 1 deletion rtl/core/neorv32_package.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ package neorv32_package is

-- Architecture Constants -----------------------------------------------------------------
-- -------------------------------------------------------------------------------------------
constant hw_version_c : std_ulogic_vector(31 downto 0) := x"01100905"; -- hardware version
constant hw_version_c : std_ulogic_vector(31 downto 0) := x"01100906"; -- hardware version
constant archid_c : natural := 19; -- official RISC-V architecture ID
constant XLEN : natural := 32; -- native data path width

Expand Down Expand Up @@ -845,6 +845,8 @@ package neorv32_package is
-- Global control --
clk_i : in std_ulogic;
rstn_i : in std_ulogic;
rstn_ocd_o : out std_ulogic;
rstn_wdt_o : out std_ulogic;
-- JTAG on-chip debugger interface (available if OCD_EN = true) --
jtag_tck_i : in std_ulogic := 'L';
jtag_tdi_i : in std_ulogic := 'L';
Expand Down
20 changes: 12 additions & 8 deletions rtl/core/neorv32_top.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ entity neorv32_top is
-- Global control --
clk_i : in std_ulogic; -- global clock, rising edge
rstn_i : in std_ulogic; -- global reset, low-active, async
rstn_ocd_o : out std_ulogic; -- watchdog reset output, low-active, sync
rstn_wdt_o : out std_ulogic; -- on-chip debugger reset output, low-active, sync

-- JTAG on-chip debugger interface (available if OCD_EN = true) --
jtag_tck_i : in std_ulogic := 'L'; -- serial clock
Expand Down Expand Up @@ -435,19 +437,21 @@ begin
-- Clock and Reset Generators
-- **************************************************************************************************************************

generators:
soc_generators:
if true generate

-- Reset Sequencer ------------------------------------------------------------------------
-- -------------------------------------------------------------------------------------------
neorv32_sys_reset_inst: entity neorv32.neorv32_sys_reset
port map (
clk_i => clk_i,
rstn_ext_i => rstn_i,
rstn_wdt_i => rstn_wdt,
rstn_dbg_i => dci_ndmrstn,
rstn_ext_o => rstn_ext,
rstn_sys_o => rstn_sys
clk_i => clk_i,
rstn_ext_i => rstn_i,
rstn_wdt_i => rstn_wdt,
rstn_dbg_i => dci_ndmrstn,
rstn_ext_o => rstn_ext,
rstn_sys_o => rstn_sys,
xrstn_wdt_o => rstn_wdt_o,
xrstn_ocd_o => rstn_ocd_o
);


Expand All @@ -469,7 +473,7 @@ begin
clk_gen_en(CG_TWI) & clk_gen_en(CG_TWD) & clk_gen_en(CG_PWM) & clk_gen_en(CG_WDT) &
clk_gen_en(CG_NEOLED) & clk_gen_en(CG_GPTMR) & clk_gen_en(CG_XIP) & clk_gen_en(CG_ONEWIRE);

end generate; -- /generators
end generate; -- /soc_generators


-- **************************************************************************************************************************
Expand Down
2 changes: 2 additions & 0 deletions sim/neorv32_tb.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@ begin
-- Global control --
clk_i => clk_gen,
rstn_i => rst_gen,
rstn_ocd_o => open,
rstn_wdt_o => open,
-- JTAG on-chip debugger interface --
jtag_tck_i => '0',
jtag_tdi_i => '0',
Expand Down

0 comments on commit e1339fb

Please sign in to comment.