ELGIP-91 - Spitting logic is now instantiated depending on a VHDL generic

This commit is contained in:
gianmarcogirau 2020-05-19 11:36:46 +01:00
commit 1f7c817499
3 changed files with 31 additions and 20 deletions

View file

@ -6,7 +6,7 @@
-- Author : Gianmarco Girau
-- Company : Global Inkjet Systems
-- Created : 2017-09-06
-- Last update: 2020-05-15
-- Last update: 2020-05-19
-- SVN ID : Git
-- Standard : VHDL'08
-------------------------------------------------------------------------------
@ -488,6 +488,7 @@ begin
generic map(
PD_QUEUE_SIZE => PD_QUEUE_SIZE,
PULSE_DELAY_EQUAL_EN => PULSE_DELAY_EQUAL_EN,
SPITTING_EN => false,
BIDIR_CH_OFFSET_EN => false,
DIAG_COUNTERS => true,
TOF_COMP_EN => TOF_COMP_EN,

View file

@ -50,7 +50,7 @@
"minor_number" : {
"type" : "c",
"bit_len" : "8",
"reset" : "0x02",
"reset" : "0x03",
"description" : "Minor number"
},
"major_number" : {

View file

@ -6,7 +6,7 @@
-- Author : Gianmarco Girau
-- Company : Global Inkjet Systems
-- Created : 2016-10-24
-- Last update: 2020-05-18
-- Last update: 2020-05-19
-- SVN ID : Git
-- Standard : VHDL'93
-------------------------------------------------------------------------------
@ -36,6 +36,7 @@ entity pulse_generator_3 is
generic(
PD_QUEUE_SIZE : natural range 32 to 1024 := 64;
PULSE_DELAY_EQUAL_EN : boolean := true;
SPITTING_EN : boolean := true;
BIDIR_CH_OFFSET_EN : boolean := true;
DIAG_COUNTERS : boolean := true;
TOF_COMP_EN : boolean := false;
@ -93,7 +94,7 @@ architecture rtl of pulse_generator_3 is
-- constants
constant CSR_IP_ID : std_logic_vector(31 downto 0) := x"0000FF13";
constant CSR_IP_VER : std_logic_vector(31 downto 0) := x"00000302";
constant CSR_IP_VER : std_logic_vector(31 downto 0) := x"00000303";
signal init_de, init_qd, enable, loc_pd, pd_queue_error : std_logic;
signal ch_ctrl_start_req, pd_pulse, filt_pd, filt_pd_d : std_logic;
@ -336,7 +337,7 @@ begin
ADD_VEC_PIPE => false,
VECT_CPU_EN => false,
VECT_RAMP_EN => false,
BUS_BURST_EN => true,
BUS_BURST_EN => SPITTING_EN,
POS_BUS_EN => true,
ALU_EN => false,
QUEUE_EN => false)
@ -604,22 +605,31 @@ begin
-- Spitting logic
-----------------------------------------------------------------------------
pSPITTING_LOGIC : process(clk)
begin
if(clk = '1' and clk'event) then
spitting_enable <= ch_ctrl_vector_out(6);
if(seq_bus_valid = '1') then
spit_nco_inc <= seq_bus_data;
gSPIT_LOGIC: if SPITTING_EN generate
pSPITTING_LOGIC : process(clk)
begin
if(clk = '1' and clk'event) then
spitting_enable <= ch_ctrl_vector_out(6);
if(seq_bus_valid = '1') then
spit_nco_inc <= seq_bus_data;
end if;
if(spitting_enable = '0') then
spit_nco <= (others => '0');
else
spit_nco <= std_logic_vector(unsigned(spit_nco)+unsigned(spit_nco_inc));
end if;
spit_nco_msb <= spit_nco(spit_nco'left);
spit_pulse <= spit_nco(spit_nco'left) and not spit_nco_msb;
end if;
if(spitting_enable = '0') then
spit_nco <= (others => '0');
else
spit_nco <= std_logic_vector(unsigned(spit_nco)+unsigned(spit_nco_inc));
end if;
spit_nco_msb <= spit_nco(spit_nco'left);
spit_pulse <= spit_nco(spit_nco'left) and not spit_nco_msb;
end if;
end process pSPITTING_LOGIC;
end process pSPITTING_LOGIC;
else generate
spitting_enable <= '0';
spit_pulse <= '0';
end generate gSPIT_LOGIC;
-----------------------------------------------------------------------------
-- Pulse Gating