Skip to content

Commit

Permalink
[control] minor edits
Browse files Browse the repository at this point in the history
  • Loading branch information
stnolting committed Jan 4, 2025
1 parent e80e134 commit 7a54bb6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions rtl/core/neorv32_cpu.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ begin
csr_rdata_o => csr_rdata, -- CSR read data
-- external CSR interface --
xcsr_we_o => xcsr_we, -- global write enable
xcsr_re_o => open, -- global read enable
xcsr_addr_o => xcsr_addr, -- address
xcsr_wdata_o => xcsr_wdata, -- write data
xcsr_rdata_i => xcsr_rdata_res, -- read data
Expand Down
6 changes: 4 additions & 2 deletions rtl/core/neorv32_cpu_control.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ entity neorv32_cpu_control is
csr_rdata_o : out std_ulogic_vector(XLEN-1 downto 0); -- CSR read data
-- external CSR interface --
xcsr_we_o : out std_ulogic; -- global write enable
xcsr_re_o : out std_ulogic; -- global read enable
xcsr_addr_o : out std_ulogic_vector(11 downto 0); -- address
xcsr_wdata_o : out std_ulogic_vector(XLEN-1 downto 0); -- write data
xcsr_rdata_i : in std_ulogic_vector(XLEN-1 downto 0); -- read data
Expand Down Expand Up @@ -385,7 +386,7 @@ begin
FIFO_WIDTH => ipb.wdata(i)'length, -- size of data elements in FIFO
FIFO_RSYNC => false, -- we NEED to read data asynchronously
FIFO_SAFE => false, -- no safe access required (ensured by FIFO-external logic)
FULL_RESET => true -- map to FFs and add a dedicated reset
FULL_RESET => false -- no need for a full hardware reset
)
port map (
-- control --
Expand Down Expand Up @@ -1035,7 +1036,7 @@ begin
end case;

when opcode_amo_c => -- atomic memory operation
if (exe_engine.ir(instr_funct3_msb_c downto instr_funct3_lsb_c) = "010") then
if RISCV_ISA_Zaamo and (exe_engine.ir(instr_funct3_msb_c downto instr_funct3_lsb_c) = "010") then
case exe_engine.ir(instr_funct5_msb_c downto instr_funct5_lsb_c) is
when "00001" | "00000" | "00100" | "01100" | "01000" | "10000" | "10100" | "11000" | "11100" => illegal_cmd <= '0';
when others => illegal_cmd <= '1';
Expand Down Expand Up @@ -1332,6 +1333,7 @@ begin
-- External CSR Interface -----------------------------------------------------------------
-- -------------------------------------------------------------------------------------------
xcsr_we_o <= csr.we;
xcsr_re_o <= '1' when (exe_engine.state = EX_SYSTEM) else '0';
xcsr_addr_o <= csr.addr;
xcsr_wdata_o <= csr.wdata;

Expand Down

0 comments on commit 7a54bb6

Please sign in to comment.