Line 39... |
Line 39... |
package neorv32_package is
|
package neorv32_package is
|
|
|
-- Architecture Constants -----------------------------------------------------------------
|
-- Architecture Constants -----------------------------------------------------------------
|
-- -------------------------------------------------------------------------------------------
|
-- -------------------------------------------------------------------------------------------
|
constant data_width_c : natural := 32; -- data width - FIXED!
|
constant data_width_c : natural := 32; -- data width - FIXED!
|
constant hw_version_c : std_ulogic_vector(31 downto 0) := x"00000206"; -- no touchy!
|
constant hw_version_c : std_ulogic_vector(31 downto 0) := x"01000000"; -- no touchy!
|
|
|
-- Internal Functions ---------------------------------------------------------------------
|
-- Internal Functions ---------------------------------------------------------------------
|
-- -------------------------------------------------------------------------------------------
|
-- -------------------------------------------------------------------------------------------
|
function index_size_f(input : natural) return natural;
|
function index_size_f(input : natural) return natural;
|
function cond_sel_natural_f(cond : boolean; val_t : natural; val_f : natural) return natural;
|
function cond_sel_natural_f(cond : boolean; val_t : natural; val_f : natural) return natural;
|
Line 51... |
Line 51... |
function bool_to_ulogic_f(cond : boolean) return std_ulogic;
|
function bool_to_ulogic_f(cond : boolean) return std_ulogic;
|
function or_all_f( a : std_ulogic_vector) return std_ulogic;
|
function or_all_f( a : std_ulogic_vector) return std_ulogic;
|
function and_all_f( a : std_ulogic_vector) return std_ulogic;
|
function and_all_f( a : std_ulogic_vector) return std_ulogic;
|
function xor_all_f( a : std_ulogic_vector) return std_ulogic;
|
function xor_all_f( a : std_ulogic_vector) return std_ulogic;
|
function xnor_all_f(a : std_ulogic_vector) return std_ulogic;
|
function xnor_all_f(a : std_ulogic_vector) return std_ulogic;
|
|
function to_hexchar_f(input : std_ulogic_vector(3 downto 0)) return character;
|
|
|
-- Processor-internal Address Space Layout ------------------------------------------------
|
-- Processor-internal Address Space Layout ------------------------------------------------
|
-- -------------------------------------------------------------------------------------------
|
-- -------------------------------------------------------------------------------------------
|
-- Instruction Memory & Data Memory --
|
-- Instruction Memory & Data Memory --
|
-- => configured via top's generics
|
-- => configured via top's generics
|
Line 158... |
Line 159... |
-- alu --
|
-- alu --
|
constant ctrl_alu_cmd0_c : natural := 20; -- ALU command bit 0
|
constant ctrl_alu_cmd0_c : natural := 20; -- ALU command bit 0
|
constant ctrl_alu_cmd1_c : natural := 21; -- ALU command bit 1
|
constant ctrl_alu_cmd1_c : natural := 21; -- ALU command bit 1
|
constant ctrl_alu_cmd2_c : natural := 22; -- ALU command bit 2
|
constant ctrl_alu_cmd2_c : natural := 22; -- ALU command bit 2
|
constant ctrl_alu_opa_mux_lsb_c : natural := 23; -- operand A select lsb (00=rs1, 01=PC)
|
constant ctrl_alu_opa_mux_lsb_c : natural := 23; -- operand A select lsb (00=rs1, 01=PC)
|
constant ctrl_alu_opa_mux_msb_c : natural := 24; -- operand A select msb (10=CSR, 11=CSR)
|
constant ctrl_alu_opa_mux_msb_c : natural := 24; -- operand A select msb (10=CSR, 11=?)
|
constant ctrl_alu_opb_mux_lsb_c : natural := 25; -- operand B select lsb (00=rs2, 01=PC)
|
constant ctrl_alu_opb_mux_lsb_c : natural := 25; -- operand B select lsb (00=rs2, 01=IMM)
|
constant ctrl_alu_opb_mux_msb_c : natural := 26; -- operand B select msb (10=rs1, 11=PC_increment(2/4))
|
constant ctrl_alu_opb_mux_msb_c : natural := 26; -- operand B select msb (10=rs1, 11=?)
|
constant ctrl_alu_opc_mux_c : natural := 27; -- operand C select (0=IMM, 1=rs2)
|
constant ctrl_alu_opc_mux_c : natural := 27; -- operand C select (0=IMM, 1=rs2)
|
constant ctrl_alu_unsigned_c : natural := 28; -- is unsigned ALU operation
|
constant ctrl_alu_unsigned_c : natural := 28; -- is unsigned ALU operation
|
constant ctrl_alu_shift_dir_c : natural := 29; -- shift direction (0=left, 1=right)
|
constant ctrl_alu_shift_dir_c : natural := 29; -- shift direction (0=left, 1=right)
|
constant ctrl_alu_shift_ar_c : natural := 30; -- is arithmetic shift
|
constant ctrl_alu_shift_ar_c : natural := 30; -- is arithmetic shift
|
-- bus interface --
|
-- bus interface --
|
Line 175... |
Line 176... |
constant ctrl_bus_if_c : natural := 35; -- instruction fetch request (1: output PC, 0: output MAR)
|
constant ctrl_bus_if_c : natural := 35; -- instruction fetch request (1: output PC, 0: output MAR)
|
constant ctrl_bus_mar_we_c : natural := 36; -- memory address register write enable
|
constant ctrl_bus_mar_we_c : natural := 36; -- memory address register write enable
|
constant ctrl_bus_mdo_we_c : natural := 37; -- memory data out register write enable
|
constant ctrl_bus_mdo_we_c : natural := 37; -- memory data out register write enable
|
constant ctrl_bus_mdi_we_c : natural := 38; -- memory data in register write enable
|
constant ctrl_bus_mdi_we_c : natural := 38; -- memory data in register write enable
|
constant ctrl_bus_unsigned_c : natural := 39; -- is unsigned load
|
constant ctrl_bus_unsigned_c : natural := 39; -- is unsigned load
|
-- csr/system --
|
|
constant ctrl_csr_pc_we_c : natural := 40; -- PC write enable
|
|
constant ctrl_csr_re_c : natural := 41; -- valid CSR read
|
|
constant ctrl_csr_we_c : natural := 42; -- valid CSR write
|
|
-- co-processor --
|
-- co-processor --
|
constant ctrl_cp_use_c : natural := 43; -- is cp operation
|
constant ctrl_cp_use_c : natural := 40; -- is cp operation
|
constant ctrl_cp_id_lsb_c : natural := 44; -- cp select lsb
|
constant ctrl_cp_id_lsb_c : natural := 41; -- cp select lsb
|
constant ctrl_cp_id_msb_c : natural := 45; -- cp select msb
|
constant ctrl_cp_id_msb_c : natural := 42; -- cp select msb
|
constant ctrl_cp_cmd0_c : natural := 46; -- cp command bit 0
|
constant ctrl_cp_cmd0_c : natural := 43; -- cp command bit 0
|
constant ctrl_cp_cmd1_c : natural := 47; -- cp command bit 1
|
constant ctrl_cp_cmd1_c : natural := 44; -- cp command bit 1
|
constant ctrl_cp_cmd2_c : natural := 48; -- cp command bit 2
|
constant ctrl_cp_cmd2_c : natural := 45; -- cp command bit 2
|
|
-- system --
|
|
constant ctrl_sys_c_ext_en_c : natural := 46; -- CPU C extension enabled
|
|
constant ctrl_sys_m_ext_en_c : natural := 47; -- CPU M extension enabled
|
-- control bus size --
|
-- control bus size --
|
constant ctrl_width_c : natural := 49; -- control bus size
|
constant ctrl_width_c : natural := 48; -- control bus size
|
|
|
-- ALU Comparator Bus ---------------------------------------------------------------------
|
-- ALU Comparator Bus ---------------------------------------------------------------------
|
-- -------------------------------------------------------------------------------------------
|
-- -------------------------------------------------------------------------------------------
|
constant alu_cmp_equal_c : natural := 0;
|
constant alu_cmp_equal_c : natural := 0;
|
constant alu_cmp_less_c : natural := 1; -- for signed and unsigned
|
constant alu_cmp_less_c : natural := 1; -- for signed and unsigned comparisons
|
|
|
-- RISC-V Opcode Layout -------------------------------------------------------------------
|
-- RISC-V Opcode Layout -------------------------------------------------------------------
|
-- -------------------------------------------------------------------------------------------
|
-- -------------------------------------------------------------------------------------------
|
constant instr_opcode_lsb_c : natural := 0; -- opcode bit 0
|
constant instr_opcode_lsb_c : natural := 0; -- opcode bit 0
|
constant instr_opcode_msb_c : natural := 6; -- opcode bit 6
|
constant instr_opcode_msb_c : natural := 6; -- opcode bit 6
|
Line 335... |
Line 335... |
generic (
|
generic (
|
-- General --
|
-- General --
|
CLOCK_FREQUENCY : natural := 0; -- clock frequency of clk_i in Hz
|
CLOCK_FREQUENCY : natural := 0; -- clock frequency of clk_i in Hz
|
HART_ID : std_ulogic_vector(31 downto 0) := x"00000000"; -- custom hardware thread ID
|
HART_ID : std_ulogic_vector(31 downto 0) := x"00000000"; -- custom hardware thread ID
|
BOOTLOADER_USE : boolean := true; -- implement processor-internal bootloader?
|
BOOTLOADER_USE : boolean := true; -- implement processor-internal bootloader?
|
|
CSR_COUNTERS_USE : boolean := true; -- implement RISC-V perf. counters ([m]instret[h], [m]cycle[h], time[h])?
|
-- RISC-V CPU Extensions --
|
-- RISC-V CPU Extensions --
|
CPU_EXTENSION_RISCV_C : boolean := false; -- implement compressed extension?
|
CPU_EXTENSION_RISCV_C : boolean := false; -- implement compressed extension?
|
CPU_EXTENSION_RISCV_E : boolean := false; -- implement embedded RF extension?
|
CPU_EXTENSION_RISCV_E : boolean := false; -- implement embedded RF extension?
|
CPU_EXTENSION_RISCV_M : boolean := false; -- implement muld/div extension?
|
CPU_EXTENSION_RISCV_M : boolean := false; -- implement muld/div extension?
|
CPU_EXTENSION_RISCV_Zicsr : boolean := true; -- implement CSR system?
|
CPU_EXTENSION_RISCV_Zicsr : boolean := true; -- implement CSR system?
|
Line 388... |
Line 389... |
gpio_i : in std_ulogic_vector(15 downto 0) := (others => '0'); -- parallel input
|
gpio_i : in std_ulogic_vector(15 downto 0) := (others => '0'); -- parallel input
|
-- UART --
|
-- UART --
|
uart_txd_o : out std_ulogic; -- UART send data
|
uart_txd_o : out std_ulogic; -- UART send data
|
uart_rxd_i : in std_ulogic := '0'; -- UART receive data
|
uart_rxd_i : in std_ulogic := '0'; -- UART receive data
|
-- SPI --
|
-- SPI --
|
spi_sclk_o : out std_ulogic; -- serial clock line
|
spi_sck_o : out std_ulogic; -- SPI serial clock
|
spi_mosi_o : out std_ulogic; -- serial data line out
|
spi_sdo_o : out std_ulogic; -- controller data out, peripheral data in
|
spi_miso_i : in std_ulogic := '0'; -- serial data line in
|
spi_sdi_i : in std_ulogic; -- controller data in, peripheral data out
|
spi_csn_o : out std_ulogic_vector(07 downto 0); -- SPI CS
|
spi_csn_o : out std_ulogic_vector(07 downto 0); -- SPI CS
|
-- TWI --
|
-- TWI --
|
twi_sda_io : inout std_logic := 'H'; -- twi serial data line
|
twi_sda_io : inout std_logic := 'H'; -- twi serial data line
|
twi_scl_io : inout std_logic := 'H'; -- twi serial clock line
|
twi_scl_io : inout std_logic := 'H'; -- twi serial clock line
|
-- PWM --
|
-- PWM --
|
Line 411... |
Line 412... |
generic (
|
generic (
|
-- General --
|
-- General --
|
CLOCK_FREQUENCY : natural := 0; -- clock frequency of clk_i in Hz
|
CLOCK_FREQUENCY : natural := 0; -- clock frequency of clk_i in Hz
|
HART_ID : std_ulogic_vector(31 downto 0) := x"00000000"; -- custom hardware thread ID
|
HART_ID : std_ulogic_vector(31 downto 0) := x"00000000"; -- custom hardware thread ID
|
BOOTLOADER_USE : boolean := true; -- implement processor-internal bootloader?
|
BOOTLOADER_USE : boolean := true; -- implement processor-internal bootloader?
|
|
CSR_COUNTERS_USE : boolean := true; -- implement RISC-V perf. counters ([m]instret[h], [m]cycle[h], time[h])?
|
-- RISC-V CPU Extensions --
|
-- RISC-V CPU Extensions --
|
CPU_EXTENSION_RISCV_C : boolean := false; -- implement compressed extension?
|
CPU_EXTENSION_RISCV_C : boolean := false; -- implement compressed extension?
|
CPU_EXTENSION_RISCV_E : boolean := false; -- implement embedded RF extension?
|
CPU_EXTENSION_RISCV_E : boolean := false; -- implement embedded RF extension?
|
CPU_EXTENSION_RISCV_M : boolean := false; -- implement muld/div extension?
|
CPU_EXTENSION_RISCV_M : boolean := false; -- implement muld/div extension?
|
CPU_EXTENSION_RISCV_Zicsr : boolean := true; -- implement CSR system?
|
CPU_EXTENSION_RISCV_Zicsr : boolean := true; -- implement CSR system?
|
Line 469... |
Line 471... |
generic (
|
generic (
|
-- General --
|
-- General --
|
CLOCK_FREQUENCY : natural := 0; -- clock frequency of clk_i in Hz
|
CLOCK_FREQUENCY : natural := 0; -- clock frequency of clk_i in Hz
|
HART_ID : std_ulogic_vector(31 downto 0) := x"00000000"; -- custom hardware thread ID
|
HART_ID : std_ulogic_vector(31 downto 0) := x"00000000"; -- custom hardware thread ID
|
BOOTLOADER_USE : boolean := true; -- implement processor-internal bootloader?
|
BOOTLOADER_USE : boolean := true; -- implement processor-internal bootloader?
|
|
CSR_COUNTERS_USE : boolean := true; -- implement RISC-V perf. counters ([m]instret[h], [m]cycle[h], time[h])?
|
-- RISC-V CPU Extensions --
|
-- RISC-V CPU Extensions --
|
CPU_EXTENSION_RISCV_C : boolean := false; -- implement compressed extension?
|
CPU_EXTENSION_RISCV_C : boolean := false; -- implement compressed extension?
|
CPU_EXTENSION_RISCV_E : boolean := false; -- implement embedded RF extension?
|
CPU_EXTENSION_RISCV_E : boolean := false; -- implement embedded RF extension?
|
CPU_EXTENSION_RISCV_M : boolean := false; -- implement muld/div extension?
|
CPU_EXTENSION_RISCV_M : boolean := false; -- implement muld/div extension?
|
CPU_EXTENSION_RISCV_Zicsr : boolean := true; -- implement CSR system?
|
CPU_EXTENSION_RISCV_Zicsr : boolean := true; -- implement CSR system?
|
Line 513... |
Line 516... |
instr_i : in std_ulogic_vector(data_width_c-1 downto 0); -- instruction
|
instr_i : in std_ulogic_vector(data_width_c-1 downto 0); -- instruction
|
cmp_i : in std_ulogic_vector(1 downto 0); -- comparator status
|
cmp_i : in std_ulogic_vector(1 downto 0); -- comparator status
|
alu_add_i : in std_ulogic_vector(data_width_c-1 downto 0); -- ALU.add result
|
alu_add_i : in std_ulogic_vector(data_width_c-1 downto 0); -- ALU.add result
|
-- data output --
|
-- data output --
|
imm_o : out std_ulogic_vector(data_width_c-1 downto 0); -- immediate
|
imm_o : out std_ulogic_vector(data_width_c-1 downto 0); -- immediate
|
pc_o : out std_ulogic_vector(data_width_c-1 downto 0); -- current PC
|
fetch_pc_o : out std_ulogic_vector(data_width_c-1 downto 0); -- PC for instruction fetch
|
alu_pc_o : out std_ulogic_vector(data_width_c-1 downto 0); -- delayed PC for ALU
|
curr_pc_o : out std_ulogic_vector(data_width_c-1 downto 0); -- current PC (corresponding to current instruction)
|
|
next_pc_o : out std_ulogic_vector(data_width_c-1 downto 0); -- next PC (corresponding to current instruction)
|
-- csr interface --
|
-- csr interface --
|
csr_wdata_i : in std_ulogic_vector(data_width_c-1 downto 0); -- CSR write data
|
csr_wdata_i : in std_ulogic_vector(data_width_c-1 downto 0); -- CSR write data
|
csr_rdata_o : out std_ulogic_vector(data_width_c-1 downto 0); -- CSR read data
|
csr_rdata_o : out std_ulogic_vector(data_width_c-1 downto 0); -- CSR read data
|
-- external interrupt --
|
-- external interrupt --
|
clic_irq_i : in std_ulogic; -- CLIC interrupt request
|
clic_irq_i : in std_ulogic; -- CLIC interrupt request
|
Line 529... |
Line 533... |
ma_load_i : in std_ulogic; -- misaligned load data address
|
ma_load_i : in std_ulogic; -- misaligned load data address
|
ma_store_i : in std_ulogic; -- misaligned store data address
|
ma_store_i : in std_ulogic; -- misaligned store data address
|
be_instr_i : in std_ulogic; -- bus error on instruction access
|
be_instr_i : in std_ulogic; -- bus error on instruction access
|
be_load_i : in std_ulogic; -- bus error on load data access
|
be_load_i : in std_ulogic; -- bus error on load data access
|
be_store_i : in std_ulogic; -- bus error on store data access
|
be_store_i : in std_ulogic; -- bus error on store data access
|
bus_exc_ack_o : out std_ulogic -- bus exception error acknowledge
|
bus_exc_ack_o : out std_ulogic; -- bus exception error acknowledge
|
|
bus_busy_i : in std_ulogic -- bus unit is busy
|
);
|
);
|
end component;
|
end component;
|
|
|
-- Component: CPU Register File -----------------------------------------------------------
|
-- Component: CPU Register File -----------------------------------------------------------
|
-- -------------------------------------------------------------------------------------------
|
-- -------------------------------------------------------------------------------------------
|
Line 557... |
Line 562... |
end component;
|
end component;
|
|
|
-- Component: CPU ALU ---------------------------------------------------------------------
|
-- Component: CPU ALU ---------------------------------------------------------------------
|
-- -------------------------------------------------------------------------------------------
|
-- -------------------------------------------------------------------------------------------
|
component neorv32_cpu_alu
|
component neorv32_cpu_alu
|
generic (
|
|
CPU_EXTENSION_RISCV_C : boolean := false; -- implement compressed extension?
|
|
CPU_EXTENSION_RISCV_M : boolean := false -- implement mul/div extension?
|
|
);
|
|
port (
|
port (
|
-- global control --
|
-- global control --
|
clk_i : in std_ulogic; -- global clock, rising edge
|
clk_i : in std_ulogic; -- global clock, rising edge
|
rstn_i : in std_ulogic; -- global reset, low-active, async
|
rstn_i : in std_ulogic; -- global reset, low-active, async
|
ctrl_i : in std_ulogic_vector(ctrl_width_c-1 downto 0); -- main control bus
|
ctrl_i : in std_ulogic_vector(ctrl_width_c-1 downto 0); -- main control bus
|
-- data input --
|
-- data input --
|
rs1_i : in std_ulogic_vector(data_width_c-1 downto 0); -- rf source 1
|
rs1_i : in std_ulogic_vector(data_width_c-1 downto 0); -- rf source 1
|
rs2_i : in std_ulogic_vector(data_width_c-1 downto 0); -- rf source 2
|
rs2_i : in std_ulogic_vector(data_width_c-1 downto 0); -- rf source 2
|
pc_i : in std_ulogic_vector(data_width_c-1 downto 0); -- current PC
|
|
pc2_i : in std_ulogic_vector(data_width_c-1 downto 0); -- delayed PC
|
pc2_i : in std_ulogic_vector(data_width_c-1 downto 0); -- delayed PC
|
imm_i : in std_ulogic_vector(data_width_c-1 downto 0); -- immediate
|
imm_i : in std_ulogic_vector(data_width_c-1 downto 0); -- immediate
|
csr_i : in std_ulogic_vector(data_width_c-1 downto 0); -- csr read data
|
csr_i : in std_ulogic_vector(data_width_c-1 downto 0); -- csr read data
|
-- data output --
|
-- data output --
|
cmp_o : out std_ulogic_vector(1 downto 0); -- comparator status
|
cmp_o : out std_ulogic_vector(1 downto 0); -- comparator status
|
Line 608... |
Line 608... |
|
|
-- Component: CPU Bus Interface -----------------------------------------------------------
|
-- Component: CPU Bus Interface -----------------------------------------------------------
|
-- -------------------------------------------------------------------------------------------
|
-- -------------------------------------------------------------------------------------------
|
component neorv32_cpu_bus
|
component neorv32_cpu_bus
|
generic (
|
generic (
|
CPU_EXTENSION_RISCV_C : boolean := false; -- implement compressed extension?
|
|
MEM_EXT_TIMEOUT : natural := 15 -- cycles after which a valid bus access will timeout
|
MEM_EXT_TIMEOUT : natural := 15 -- cycles after which a valid bus access will timeout
|
);
|
);
|
port (
|
port (
|
-- global control --
|
-- global control --
|
clk_i : in std_ulogic; -- global clock, rising edge
|
clk_i : in std_ulogic; -- global clock, rising edge
|
Line 632... |
Line 631... |
ma_store_o : out std_ulogic; -- misaligned store data address
|
ma_store_o : out std_ulogic; -- misaligned store data address
|
be_instr_o : out std_ulogic; -- bus error on instruction access
|
be_instr_o : out std_ulogic; -- bus error on instruction access
|
be_load_o : out std_ulogic; -- bus error on load data access
|
be_load_o : out std_ulogic; -- bus error on load data access
|
be_store_o : out std_ulogic; -- bus error on store data
|
be_store_o : out std_ulogic; -- bus error on store data
|
bus_wait_o : out std_ulogic; -- wait for bus operation to finish
|
bus_wait_o : out std_ulogic; -- wait for bus operation to finish
|
|
bus_busy_o : out std_ulogic; -- bus unit is busy
|
exc_ack_i : in std_ulogic; -- exception controller ACK
|
exc_ack_i : in std_ulogic; -- exception controller ACK
|
-- bus system --
|
-- bus system --
|
bus_addr_o : out std_ulogic_vector(data_width_c-1 downto 0); -- bus access address
|
bus_addr_o : out std_ulogic_vector(data_width_c-1 downto 0); -- bus access address
|
bus_rdata_i : in std_ulogic_vector(data_width_c-1 downto 0); -- bus read data
|
bus_rdata_i : in std_ulogic_vector(data_width_c-1 downto 0); -- bus read data
|
bus_wdata_o : out std_ulogic_vector(data_width_c-1 downto 0); -- bus write data
|
bus_wdata_o : out std_ulogic_vector(data_width_c-1 downto 0); -- bus write data
|
Line 652... |
Line 652... |
component neorv32_cpu_decompressor
|
component neorv32_cpu_decompressor
|
port (
|
port (
|
-- instruction input --
|
-- instruction input --
|
ci_instr16_i : in std_ulogic_vector(15 downto 0); -- compressed instruction input
|
ci_instr16_i : in std_ulogic_vector(15 downto 0); -- compressed instruction input
|
-- instruction output --
|
-- instruction output --
|
ci_valid_o : out std_ulogic; -- is a compressed instruction
|
|
ci_illegal_o : out std_ulogic; -- is an illegal compressed instruction
|
ci_illegal_o : out std_ulogic; -- is an illegal compressed instruction
|
ci_instr32_o : out std_ulogic_vector(31 downto 0) -- 32-bit decompressed instruction
|
ci_instr32_o : out std_ulogic_vector(31 downto 0) -- 32-bit decompressed instruction
|
);
|
);
|
end component;
|
end component;
|
|
|
Line 836... |
Line 835... |
ack_o : out std_ulogic; -- transfer acknowledge
|
ack_o : out std_ulogic; -- transfer acknowledge
|
-- clock generator --
|
-- clock generator --
|
clkgen_en_o : out std_ulogic; -- enable clock generator
|
clkgen_en_o : out std_ulogic; -- enable clock generator
|
clkgen_i : in std_ulogic_vector(07 downto 0);
|
clkgen_i : in std_ulogic_vector(07 downto 0);
|
-- com lines --
|
-- com lines --
|
spi_sclk_o : out std_ulogic; -- SPI serial clock
|
spi_sck_o : out std_ulogic; -- SPI serial clock
|
spi_mosi_o : out std_ulogic; -- SPI master out, slave in
|
spi_sdo_o : out std_ulogic; -- controller data out, peripheral data in
|
spi_miso_i : in std_ulogic; -- SPI master in, slave out
|
spi_sdi_i : in std_ulogic; -- controller data in, peripheral data out
|
spi_csn_o : out std_ulogic_vector(07 downto 0); -- SPI CS
|
spi_csn_o : out std_ulogic_vector(07 downto 0); -- SPI CS
|
-- interrupt --
|
-- interrupt --
|
spi_irq_o : out std_ulogic -- transmission done interrupt
|
spi_irq_o : out std_ulogic -- transmission done interrupt
|
);
|
);
|
end component;
|
end component;
|
Line 1061... |
Line 1060... |
tmp_v := tmp_v xnor a(i);
|
tmp_v := tmp_v xnor a(i);
|
end loop; -- i
|
end loop; -- i
|
return tmp_v;
|
return tmp_v;
|
end function xnor_all_f;
|
end function xnor_all_f;
|
|
|
|
-- Function: Convert to hex char ----------------------------------------------------------
|
|
-- -------------------------------------------------------------------------------------------
|
|
function to_hexchar_f(input : std_ulogic_vector(3 downto 0)) return character is
|
|
variable output_v : character;
|
|
begin
|
|
case input is
|
|
when x"0" => output_v := '0';
|
|
when x"1" => output_v := '1';
|
|
when x"2" => output_v := '2';
|
|
when x"3" => output_v := '3';
|
|
when x"4" => output_v := '4';
|
|
when x"5" => output_v := '5';
|
|
when x"6" => output_v := '6';
|
|
when x"7" => output_v := '7';
|
|
when x"8" => output_v := '8';
|
|
when x"9" => output_v := '9';
|
|
when x"a" => output_v := 'a';
|
|
when x"b" => output_v := 'b';
|
|
when x"c" => output_v := 'c';
|
|
when x"d" => output_v := 'd';
|
|
when x"e" => output_v := 'e';
|
|
when x"f" => output_v := 'f';
|
|
when others => output_v := '?';
|
|
end case;
|
|
return output_v;
|
|
end function to_hexchar_f;
|
|
|
end neorv32_package;
|
end neorv32_package;
|
|
|
No newline at end of file
|
No newline at end of file
|