Skip to content

Commit

Permalink
[top] add GPTMR capture input
Browse files Browse the repository at this point in the history
  • Loading branch information
stnolting committed Jan 3, 2024
1 parent af02f12 commit d31320a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
8 changes: 5 additions & 3 deletions rtl/core/neorv32_package.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
-- # ********************************************************************************************* #
-- # BSD 3-Clause License #
-- # #
-- # Copyright (c) 2023, Stephan Nolting. All rights reserved. #
-- # Copyright (c) 2024, Stephan Nolting. All rights reserved. #
-- # #
-- # Redistribution and use in source and binary forms, with or without modification, are #
-- # permitted provided that the following conditions are met: #
Expand Down Expand Up @@ -56,7 +56,7 @@ package neorv32_package is

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

Expand Down Expand Up @@ -865,7 +865,7 @@ package neorv32_package is
-- Advanced memory control signals --
fence_o : out std_ulogic;
fencei_o : out std_ulogic;
-- XIP (execute in place via SPI) signals (available if IO_XIP_EN = true) --
-- XIP (execute in-place via SPI) signals (available if IO_XIP_EN = true) --
xip_csn_o : out std_ulogic;
xip_clk_o : out std_ulogic;
xip_dat_i : in std_ulogic := 'L';
Expand Down Expand Up @@ -908,6 +908,8 @@ package neorv32_package is
cfs_out_o : out std_ulogic_vector(IO_CFS_OUT_SIZE-1 downto 0);
-- NeoPixel-compatible smart LED interface (available if IO_NEOLED_EN = true) --
neoled_o : out std_ulogic;
-- GPTMR timer capture (available if IO_GPTMR_EN = true) --
gptmr_trig_i : in std_ulogic := 'L';
-- External platform interrupts (available if XIRQ_NUM_CH > 0) --
xirq_i : in std_ulogic_vector(31 downto 0) := (others => 'L');
-- CPU Interrupts --
Expand Down
8 changes: 6 additions & 2 deletions rtl/core/neorv32_top.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
-- # ********************************************************************************************* #
-- # BSD 3-Clause License #
-- # #
-- # Copyright (c) 2023, Stephan Nolting. All rights reserved. #
-- # Copyright (c) 2024, Stephan Nolting. All rights reserved. #
-- # #
-- # Redistribution and use in source and binary forms, with or without modification, are #
-- # permitted provided that the following conditions are met: #
Expand Down Expand Up @@ -241,6 +241,9 @@ entity neorv32_top is
-- NeoPixel-compatible smart LED interface (available if IO_NEOLED_EN = true) --
neoled_o : out std_ulogic; -- async serial data line

-- GPTMR timer capture (available if IO_GPTMR_EN = true) --
gptmr_trig_i : in std_ulogic := 'L'; -- capture trigger

-- External platform interrupts (available if XIRQ_NUM_CH > 0) --
xirq_i : in std_ulogic_vector(31 downto 0) := (others => 'L'); -- IRQ channels

Expand Down Expand Up @@ -1375,7 +1378,8 @@ begin
bus_rsp_o => iodev_rsp(IODEV_GPTMR),
clkgen_en_o => cg_en.gptmr,
clkgen_i => clk_gen,
irq_o => firq.gptmr
irq_o => firq.gptmr,
capture_i => gptmr_trig_i
);
end generate;

Expand Down
4 changes: 3 additions & 1 deletion sim/neorv32_tb.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
-- # ********************************************************************************************* #
-- # BSD 3-Clause License #
-- # #
-- # Copyright (c) 2023, Stephan Nolting. All rights reserved. #
-- # Copyright (c) 2024, Stephan Nolting. All rights reserved. #
-- # #
-- # Redistribution and use in source and binary forms, with or without modification, are #
-- # permitted provided that the following conditions are met: #
Expand Down Expand Up @@ -377,6 +377,8 @@ begin
cfs_out_o => open, -- custom CFS outputs
-- NeoPixel-compatible smart LED interface (available if IO_NEOLED_EN = true) --
neoled_o => open, -- async serial data line
-- GPTMR timer capture (available if IO_GPTMR_EN = true) --
gptmr_trig_i => gpio(63), -- capture trigger
-- External platform interrupts (available if XIRQ_NUM_CH > 0) --
xirq_i => gpio(31 downto 0), -- IRQ channels
-- CPU Interrupts --
Expand Down
4 changes: 3 additions & 1 deletion sim/simple/neorv32_tb.simple.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
-- # ********************************************************************************************* #
-- # BSD 3-Clause License #
-- # #
-- # Copyright (c) 2023, Stephan Nolting. All rights reserved. #
-- # Copyright (c) 2024, Stephan Nolting. All rights reserved. #
-- # #
-- # Redistribution and use in source and binary forms, with or without modification, are #
-- # permitted provided that the following conditions are met: #
Expand Down Expand Up @@ -325,6 +325,8 @@ begin
cfs_out_o => open, -- custom CFS outputs
-- NeoPixel-compatible smart LED interface (available if IO_NEOLED_EN = true) --
neoled_o => open, -- async serial data line
-- GPTMR timer capture (available if IO_GPTMR_EN = true) --
gptmr_trig_i => gpio(63), -- capture trigger
-- External platform interrupts (available if XIRQ_NUM_CH > 0) --
xirq_i => gpio(31 downto 0), -- IRQ channels
-- CPU Interrupts --
Expand Down

0 comments on commit d31320a

Please sign in to comment.