From 4b513bd3c8bee6d484243ca69b0c7eedc2b8cfa3 Mon Sep 17 00:00:00 2001 From: Pavel Pisa Date: Tue, 30 Dec 2014 09:45:15 +0100 Subject: [PATCH] Set of VHDL design workaround to allow whole design compile by GHDL. IRC subsystem is removed from lx_rocon_top.vhd because its inclusion causes exception in GHDL. Signed-off-by: Pavel Pisa --- hw/bus_irc.vhd | 4 +-- hw/irc_proc_main.vhd | 2 +- hw/lx_rocon_pkg.vhd | 12 +++---- hw/lx_rocon_top.vhd | 65 ++++--------------------------------- hw/tb/Makefile | 6 ++-- hw/xilinx_dualport_bram.vhd | 2 +- 6 files changed, 19 insertions(+), 72 deletions(-) diff --git a/hw/bus_irc.vhd b/hw/bus_irc.vhd index 8221655..327b429 100644 --- a/hw/bus_irc.vhd +++ b/hw/bus_irc.vhd @@ -19,13 +19,13 @@ entity bus_irc is -- bls_i : in std_logic_vector(3 downto 0); -- Signals for IRC - irc_i : in IRC_INPUT_Array_Type(7 downto 0) + irc_i : in IRC_INPUT_Array_Type ); end bus_irc; architecture Behavioral of bus_irc is - signal irc_o_s : IRC_OUTPUT_Array_Type(7 downto 0); + signal irc_o_s : IRC_OUTPUT_Array_Type; signal reset_index_event_s : std_logic_vector(7 downto 0); signal reset_index_event2_s : std_logic_vector(7 downto 0); signal reset_ab_error_s : std_logic_vector(7 downto 0); diff --git a/hw/irc_proc_main.vhd b/hw/irc_proc_main.vhd index 206ef63..18018f2 100644 --- a/hw/irc_proc_main.vhd +++ b/hw/irc_proc_main.vhd @@ -20,7 +20,7 @@ entity irc_proc_main is clk_i : in std_logic; reset_i : in std_logic; -- Signals from IRC - irc_i : in IRC_COUNT_OUTPUT_Array_Type((num_irc_g-1) downto 0); + irc_i : in IRC_COUNT_OUTPUT_Array_Type; -- Index resetting irc_index_reset_o : out std_logic_vector((num_irc_g-1) downto 0); -- BRAM access diff --git a/hw/lx_rocon_pkg.vhd b/hw/lx_rocon_pkg.vhd index 85bec18..da7e58a 100644 --- a/hw/lx_rocon_pkg.vhd +++ b/hw/lx_rocon_pkg.vhd @@ -36,10 +36,10 @@ package lx_rocon_pkg is end record; -- Arrays - type IRC_INPUT_Array_Type is array (natural range <>) of IRC_INPUT_Type; - type IRC_OUTPUT_Array_Type is array (natural range <>) of IRC_OUTPUT_Type; - type IRC_COUNT_OUTPUT_Array_Type is array (natural range <>) of IRC_COUNT_OUTPUT_Type; - type IRC_STATE_OUTPUT_Array_Type is array (natural range <>) of IRC_STATE_OUTPUT_Type; + type IRC_INPUT_Array_Type is array (7 downto 0) of IRC_INPUT_Type; + type IRC_OUTPUT_Array_Type is array (7 downto 0) of IRC_OUTPUT_Type; + type IRC_COUNT_OUTPUT_Array_Type is array (7 downto 0) of IRC_COUNT_OUTPUT_Type; + type IRC_STATE_OUTPUT_Array_Type is array (7 downto 0) of IRC_STATE_OUTPUT_Type; -- IRC coprocessor MAIN component irc_proc_main @@ -53,7 +53,7 @@ package lx_rocon_pkg is clk_i : in std_logic; reset_i : in std_logic; -- Signals from IRC - irc_i : in IRC_COUNT_OUTPUT_Array_Type((num_irc_g-1) downto 0); + irc_i : in IRC_COUNT_OUTPUT_Array_Type; -- Index resetting irc_index_reset_o : out std_logic_vector((num_irc_g-1) downto 0); -- BRAM access @@ -413,7 +413,7 @@ package lx_rocon_pkg is -- bls_i : in std_logic_vector(3 downto 0); -- Signals for IRC - irc_i : in IRC_INPUT_Array_Type(7 downto 0) + irc_i : in IRC_INPUT_Array_Type ); end component; diff --git a/hw/lx_rocon_top.vhd b/hw/lx_rocon_top.vhd index 25cf26b..97053c4 100644 --- a/hw/lx_rocon_top.vhd +++ b/hw/lx_rocon_top.vhd @@ -4,8 +4,8 @@ use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; use ieee.numeric_std.all; -library unisim; -use unisim.vcomponents.all; +-- library unisim; +-- use unisim.vcomponents.all; use work.mbl_pkg.all; use work.lx_rocon_pkg.all; @@ -183,13 +183,13 @@ architecture Behavioral of lx_rocon_top is -- XST attributes attribute REGISTER_DUPLICATION : string; - attribute REGISTER_DUPLICATION of rd : signal is "NO"; + -- attribute REGISTER_DUPLICATION of rd : signal is "NO"; attribute REGISTER_DUPLICATION of rd_f_s : signal is "NO"; - attribute REGISTER_DUPLICATION of bls : signal is "NO"; + -- attribute REGISTER_DUPLICATION of bls : signal is "NO"; attribute REGISTER_DUPLICATION of bls_f_s : signal is "NO"; - attribute REGISTER_DUPLICATION of address : signal is "NO"; + -- attribute REGISTER_DUPLICATION of address : signal is "NO"; attribute REGISTER_DUPLICATION of address_f_s : signal is "NO"; - attribute REGISTER_DUPLICATION of cs0_xc : signal is "NO"; + -- attribute REGISTER_DUPLICATION of cs0_xc : signal is "NO"; begin @@ -223,59 +223,6 @@ memory_bus_measurement: bus_measurement data_o => meas_out_s ); --- IRC interconnect -memory_bus_irc: bus_irc - port map - ( - reset_i => reset_s, - -- - clk_i => clk_50m, - address_i => tumbl_address_s(4 downto 0), - next_ce_i => irc_proc_next_ce_s, - data_i => tumbl_data_i_s, - data_o => irc_proc_out_s, - bls_i => tumbl_bls_s, - -- - irc_i(0).a => irc0_a, - irc_i(0).b => irc0_b, - irc_i(0).index => irc0_index, - irc_i(0).mark => irc0_mark, - -- - irc_i(1).a => irc1_a, - irc_i(1).b => irc1_b, - irc_i(1).index => irc1_index, - irc_i(1).mark => irc1_mark, - -- - irc_i(2).a => irc2_a, - irc_i(2).b => irc2_b, - irc_i(2).index => irc2_index, - irc_i(2).mark => irc2_mark, - -- - irc_i(3).a => irc3_a, - irc_i(3).b => irc3_b, - irc_i(3).index => irc3_index, - irc_i(3).mark => irc3_mark, - -- - irc_i(4).a => irc4_a, - irc_i(4).b => irc4_b, - irc_i(4).index => irc4_index, - irc_i(4).mark => irc4_mark, - -- - irc_i(5).a => irc5_a, - irc_i(5).b => irc5_b, - irc_i(5).index => irc5_index, - irc_i(5).mark => irc5_mark, - -- - irc_i(6).a => irc6_a, - irc_i(6).b => irc6_b, - irc_i(6).index => irc6_index, - irc_i(6).mark => irc6_mark, - -- - irc_i(7).a => irc7_a, - irc_i(7).b => irc7_b, - irc_i(7).index => irc7_index, - irc_i(7).mark => irc7_mark - ); -- LX Master memory_bus_lxmaster: bus_lxmaster diff --git a/hw/tb/Makefile b/hw/tb/Makefile index 389c9ad..c9fcb8f 100644 --- a/hw/tb/Makefile +++ b/hw/tb/Makefile @@ -13,13 +13,13 @@ lx_rocon_SRC=dff3.vhd qcounter.vhd \ dff2.vhd bus_tumbl.vhd bus_measurement.vhd bus_lxmaster.vhd bus_irc.vhd lx_rocon_top.vhd lx_rocon_DIR=.. -MODULES=tumbl lx_util lx_rocon_tumbl +MODULES=tumbl lx_util lx_rocon_tumbl lx_rocon lx_fncapprox SRC=$(foreach m, $(MODULES), $($(m)_SRC:%=$($(m)_DIR)/%)) $(warning SRC=$(SRC)) -#SRC+=lx_rocon_top_tb.vhd +SRC+=lx_rocon_top_tb.vhd SRC+=lx_tumbl_tb.vhd CFLAGS += -Wall @@ -29,7 +29,7 @@ ANALYZEFLAGS+=--std=93c --ieee=synopsys -fexplicit -ggdb #SIM_FLAGS=--stop-time=1000ns #--ieee-asserts=disable -all: test-tumbl +all: test-rocon convert_bin2bits : convert_bin2bits.o diff --git a/hw/xilinx_dualport_bram.vhd b/hw/xilinx_dualport_bram.vhd index 27ed368..1bcae79 100644 --- a/hw/xilinx_dualport_bram.vhd +++ b/hw/xilinx_dualport_bram.vhd @@ -36,7 +36,7 @@ entity xilinx_dualport_bram is end xilinx_dualport_bram; architecture Behavioral of xilinx_dualport_bram is - type ram is array (0 to ((2**address_width) - 1)) of std_logic_vector(((byte_width*we_width)-1) downto 0); + type ram is array (0 to 4095) of std_logic_vector(((byte_width*we_width)-1) downto 0); shared variable ram_block : ram := (others => (others => '0')); begin -- 2.39.2