HMBFDHV-83 Declared in JSON as a minor change so far as timing is unchanged. pipelined the maths on delay times to help improve timing closure.
This commit is contained in:
parent
561aa7bf6e
commit
6a2ef72157
7 changed files with 621 additions and 620 deletions
|
|
@ -68,7 +68,7 @@ architecture RTL of queue_and_delay is
|
|||
signal cnt_dir_i, wave_out_i_d, new_event : std_logic;
|
||||
signal wave_out_ii, shf_enable : std_logic;
|
||||
signal delay_line : std_logic_vector( 7 downto 0);
|
||||
signal local_time, local_time_d, event_time : std_logic_vector(31 downto 0);
|
||||
signal int_time, local_time_d, event_time : std_logic_vector(31 downto 0);
|
||||
|
||||
begin -- RTL
|
||||
|
||||
|
|
@ -93,7 +93,7 @@ begin -- RTL
|
|||
FIFO_DEPTH => queue_size)
|
||||
port map (
|
||||
clock => clk,
|
||||
data => local_time,
|
||||
data => int_time,
|
||||
rdreq => fifo_rd_en,
|
||||
sclr => init,
|
||||
wrreq => toggle_in,
|
||||
|
|
@ -118,24 +118,24 @@ begin -- RTL
|
|||
|
||||
-- Time reference: either use the external one or generate it locally
|
||||
gTIME_REF0: if use_ext_time = true generate
|
||||
local_time <= ext_time;
|
||||
int_time <= ext_time;
|
||||
|
||||
shf_enable <= '1' when local_time /= local_time_d else '0';
|
||||
shf_enable <= '1' when int_time /= local_time_d else '0';
|
||||
|
||||
--pTimeElapsed : process(cnt_dir, local_time, event_time, delay)
|
||||
--pTimeElapsed : process(cnt_dir, int_time, event_time, delay)
|
||||
pTimeElapsed : process(clk)
|
||||
begin
|
||||
if(clk = '1' and clk'event) then
|
||||
local_time_d <= local_time;
|
||||
local_time_d <= int_time;
|
||||
cnt_dir_i <= cnt_dir;
|
||||
if(cnt_dir_i = '0') then
|
||||
if(signed(local_time) >= signed(event_time) + signed(delay)) then
|
||||
if(signed(int_time) >= signed(event_time) + signed(delay)) then
|
||||
time_elapsed <= '1';
|
||||
else
|
||||
time_elapsed <= '0';
|
||||
end if;
|
||||
else
|
||||
if(signed(local_time) <= signed(event_time) - signed(delay)) then
|
||||
if(signed(int_time) <= signed(event_time) - signed(delay)) then
|
||||
time_elapsed <= '1';
|
||||
else
|
||||
time_elapsed <= '0';
|
||||
|
|
@ -152,18 +152,18 @@ begin -- RTL
|
|||
pGEN_LOC_REF : process(rstN, clk)
|
||||
begin
|
||||
if(rstN = '0') then
|
||||
local_time <= (others => '0');
|
||||
int_time <= (others => '0');
|
||||
elsif(clk = '1' and clk'event) then
|
||||
if(init = '1') then
|
||||
local_time <= (others => '0');
|
||||
int_time <= (others => '0');
|
||||
else
|
||||
local_time <= std_logic_vector(unsigned(local_time)+1);
|
||||
int_time <= std_logic_vector(unsigned(int_time)+1);
|
||||
end if;
|
||||
end if;
|
||||
end process pGEN_LOC_REF;
|
||||
|
||||
new_event <= fifo_rd_en;
|
||||
time_elapsed <= '1' when unsigned(local_time) >= unsigned(event_time) + unsigned(delay) else '0';
|
||||
time_elapsed <= '1' when unsigned(int_time) >= unsigned(event_time) + unsigned(delay) else '0';
|
||||
|
||||
shf_enable <= '1';
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
"minor_number" : {
|
||||
"type" : "c",
|
||||
"bit_len" : "8",
|
||||
"reset" : "0x01",
|
||||
"reset" : "0x02",
|
||||
"description" : "Minor number"
|
||||
},
|
||||
"major_number" : {
|
||||
|
|
|
|||
|
|
@ -72,13 +72,13 @@ vcom -2008 -work $WORKLIB $TB_PATH/fire_pulse_manager_1_tb.vhd
|
|||
vsim -t ps work.fire_pulse_manager_1_tb
|
||||
|
||||
# Add waves
|
||||
add wave -r sim:/fire_pulse_manager_1_tb/*
|
||||
#add wave -r sim:/fire_pulse_manager_1_tb/*
|
||||
|
||||
# remove warnings from standard numeric/arithmetic packages (speed-up simulation)
|
||||
set StdArithNoWarnings 1
|
||||
set NumericStdNoWarnings 1
|
||||
|
||||
when -label end_of_simulation {test_completed == true} {echo "Simulation Completed"; stop ;}
|
||||
#when -label end_of_simulation {test_completed == true} {echo "Simulation Completed"; stop ;}
|
||||
run -all
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ library ieee;
|
|||
use ieee.std_logic_1164.all;
|
||||
use ieee.numeric_std.all;
|
||||
|
||||
library work;
|
||||
use work.fire_pulse_1_pkg.all;
|
||||
|
||||
entity fire_pulse_manager_1 is
|
||||
|
|
@ -31,14 +30,14 @@ entity fire_pulse_manager_1 is
|
|||
pof_rx : in std_logic;
|
||||
pof_tx : out std_logic;
|
||||
pof_iso_en : out std_logic;
|
||||
fire_pulse : out std_logic_vector(ch_num-1 downto 0);
|
||||
mon_pt : out std_logic_vector( 3 downto 0); -- Monitoring Points
|
||||
-- on header J7
|
||||
fire_pulse : out std_logic_vector(ch_num - 1 downto 0);
|
||||
mon_pt : out std_logic_vector(3 downto 0); -- Monitoring Points
|
||||
-- on header J7
|
||||
-- Interrupt Senders
|
||||
ins_fpm_irq_0 : out std_logic;
|
||||
ins_fpm_irq_1 : out std_logic;
|
||||
ins_fpm_irq_2 : out std_logic;
|
||||
ins_fpm_irq_3 : out std_logic;
|
||||
ins_fpm_irq_1 : out std_logic; -- @suppress "Unused port: ins_fpm_irq_1 is not used in work.fire_pulse_manager_1(rtl)"
|
||||
ins_fpm_irq_2 : out std_logic; -- @suppress "Unused port: ins_fpm_irq_2 is not used in work.fire_pulse_manager_1(rtl)"
|
||||
ins_fpm_irq_3 : out std_logic; -- @suppress "Unused port: ins_fpm_irq_3 is not used in work.fire_pulse_manager_1(rtl)"
|
||||
-- Avalon MM (Slave) Interface
|
||||
avs_address : in std_logic_vector(14 downto 0);
|
||||
avs_write : in std_logic;
|
||||
|
|
@ -49,241 +48,119 @@ entity fire_pulse_manager_1 is
|
|||
end entity fire_pulse_manager_1;
|
||||
|
||||
architecture rtl of fire_pulse_manager_1 is
|
||||
|
||||
signal reset_n_i : std_logic;
|
||||
|
||||
signal reset_n_i : std_logic;
|
||||
--
|
||||
signal cs_addr : std_logic_vector(10 downto 0);
|
||||
signal cs_write_en : std_logic_vector(blk_num-1 downto 0);
|
||||
signal cs_write_data : std_logic_vector(31 downto 0);
|
||||
signal cs_read_en : std_logic_vector(blk_num-1 downto 0);
|
||||
signal cs_read_valid : std_logic_vector(blk_num-1 downto 0);
|
||||
signal cs_read_data : std_logic_vector(32*blk_num-1 downto 0);
|
||||
signal cs_addr : std_logic_vector(10 downto 0);
|
||||
signal cs_write_en : std_logic_vector(blk_num - 1 downto 0);
|
||||
signal cs_write_data : std_logic_vector(31 downto 0);
|
||||
signal cs_read_en : std_logic_vector(blk_num - 1 downto 0);
|
||||
signal cs_read_valid : std_logic_vector(blk_num - 1 downto 0);
|
||||
signal cs_read_data : std_logic_vector(32 * blk_num - 1 downto 0);
|
||||
--
|
||||
signal cs_ctrl_write_en : std_logic;
|
||||
signal cs_ctrl_read_en : std_logic;
|
||||
signal cs_ctrl_read_valid : std_logic;
|
||||
signal cs_ctrl_read_data : std_logic_vector(31 downto 0);
|
||||
signal cs_ctrl_write_en : std_logic;
|
||||
signal cs_ctrl_read_en : std_logic;
|
||||
signal cs_ctrl_read_valid : std_logic;
|
||||
signal cs_ctrl_read_data : std_logic_vector(31 downto 0);
|
||||
--
|
||||
signal cs_pg_write_en : std_logic_vector(ch_num-1 downto 0);
|
||||
signal cs_pg_read_en : std_logic_vector(ch_num-1 downto 0);
|
||||
signal cs_pg_read_valid : std_logic_vector(ch_num-1 downto 0);
|
||||
signal cs_pg_read_data : std_logic_vector(32*ch_num-1 downto 0);
|
||||
signal cs_pg_write_en : std_logic_vector(ch_num - 1 downto 0);
|
||||
signal cs_pg_read_en : std_logic_vector(ch_num - 1 downto 0);
|
||||
signal cs_pg_read_valid : std_logic_vector(ch_num - 1 downto 0);
|
||||
signal cs_pg_read_data : std_logic_vector(32 * ch_num - 1 downto 0);
|
||||
--
|
||||
signal cs_nsnk_write_en : std_logic;
|
||||
signal cs_nsnk_read_en : std_logic;
|
||||
signal cs_nsnk_read_valid : std_logic;
|
||||
signal cs_nsnk_read_data : std_logic_vector(31 downto 0);
|
||||
signal cs_nsnk_write_en : std_logic;
|
||||
signal cs_nsnk_read_en : std_logic;
|
||||
signal cs_nsnk_read_valid : std_logic;
|
||||
signal cs_nsnk_read_data : std_logic_vector(31 downto 0);
|
||||
--
|
||||
signal cs_log_write_en : std_logic;
|
||||
signal cs_log_read_en : std_logic;
|
||||
signal cs_log_read_valid : std_logic;
|
||||
signal cs_log_read_data : std_logic_vector(31 downto 0);
|
||||
signal cs_log_write_en : std_logic;
|
||||
signal cs_log_read_en : std_logic;
|
||||
signal cs_log_read_valid : std_logic;
|
||||
signal cs_log_read_data : std_logic_vector(31 downto 0);
|
||||
--
|
||||
signal cs_ie_write_en : std_logic;
|
||||
signal cs_ie_read_en : std_logic;
|
||||
signal cs_ie_read_valid : std_logic;
|
||||
signal cs_ie_read_data : std_logic_vector(31 downto 0);
|
||||
signal cs_ie_write_en : std_logic;
|
||||
signal cs_ie_read_en : std_logic;
|
||||
signal cs_ie_read_valid : std_logic;
|
||||
signal cs_ie_read_data : std_logic_vector(31 downto 0);
|
||||
--
|
||||
signal enable_rx : std_logic;
|
||||
signal uart_regen_bypass : std_logic;
|
||||
signal upd_max_pos : std_logic;
|
||||
signal upd_min_pos : std_logic;
|
||||
signal max_error_flag : std_logic;
|
||||
signal rx_watchdog : std_logic;
|
||||
signal rx_watchdog_en : std_logic;
|
||||
signal rx_watchdog_clr : std_logic;
|
||||
signal bit_div : std_logic_vector( 3 downto 0);
|
||||
signal error_rate_thres : std_logic_vector( 7 downto 0);
|
||||
signal parity_err_cnt : std_logic_vector(15 downto 0);
|
||||
signal skip_pos_cnt : std_logic_vector(15 downto 0);
|
||||
signal mon_point_src : std_logic_vector(15 downto 0);
|
||||
signal fine_time : std_logic_vector(27 downto 0);
|
||||
signal coarse_time : std_logic_vector(31 downto 0);
|
||||
signal enable_rx : std_logic;
|
||||
signal uart_regen_bypass : std_logic;
|
||||
signal upd_max_pos : std_logic;
|
||||
signal upd_min_pos : std_logic;
|
||||
signal max_error_flag : std_logic;
|
||||
signal rx_watchdog : std_logic;
|
||||
signal rx_watchdog_en : std_logic;
|
||||
signal rx_watchdog_clr : std_logic;
|
||||
signal bit_div : std_logic_vector(3 downto 0);
|
||||
signal error_rate_thres : std_logic_vector(7 downto 0);
|
||||
signal parity_err_cnt : std_logic_vector(15 downto 0);
|
||||
signal skip_pos_cnt : std_logic_vector(15 downto 0);
|
||||
signal mon_point_src : std_logic_vector(15 downto 0);
|
||||
signal fine_time : std_logic_vector(27 downto 0);
|
||||
signal coarse_time : std_logic_vector(31 downto 0);
|
||||
--
|
||||
signal remote_init : std_logic;
|
||||
signal dp_dir : std_logic_vector(ch_num-1 downto 0);
|
||||
signal set_pos_ie : std_logic;
|
||||
signal enc_pulse : std_logic;
|
||||
signal enc_pulse_ie : std_logic;
|
||||
signal enc_pulse_pof : std_logic;
|
||||
signal pd_pulse : std_logic;
|
||||
signal pd_pulse_ie : std_logic;
|
||||
signal pd_pulse_pof : std_logic;
|
||||
signal inc_pos : std_logic;
|
||||
signal inc_pos_pof : std_logic;
|
||||
signal inc_pos_ie : std_logic;
|
||||
signal dec_pos : std_logic;
|
||||
signal dec_pos_pof : std_logic;
|
||||
signal dec_pos_ie : std_logic;
|
||||
signal abs_pos : std_logic_vector(31 downto 0);
|
||||
signal abs_pos_pof : std_logic_vector(31 downto 0);
|
||||
signal abs_pos_ie : std_logic_vector(39 downto 0);
|
||||
signal remote_init : std_logic;
|
||||
signal dp_dir : std_logic_vector(ch_num - 1 downto 0);
|
||||
signal set_pos_ie : std_logic;
|
||||
signal enc_pulse : std_logic;
|
||||
signal enc_pulse_ie : std_logic;
|
||||
signal enc_pulse_pof : std_logic;
|
||||
signal pd_pulse : std_logic;
|
||||
signal pd_pulse_ie : std_logic;
|
||||
signal pd_pulse_pof : std_logic;
|
||||
signal inc_pos : std_logic;
|
||||
signal inc_pos_pof : std_logic;
|
||||
signal inc_pos_ie : std_logic;
|
||||
signal dec_pos : std_logic;
|
||||
signal dec_pos_pof : std_logic;
|
||||
signal dec_pos_ie : std_logic;
|
||||
signal abs_pos : std_logic_vector(31 downto 0);
|
||||
signal abs_pos_pof : std_logic_vector(31 downto 0);
|
||||
signal abs_pos_ie : std_logic_vector(39 downto 0);
|
||||
--
|
||||
signal ch_pd, ch_pulse_out : std_logic_vector(ch_num-1 downto 0);
|
||||
signal ch_raw_pulse, ch_mask : std_logic_vector(ch_num-1 downto 0);
|
||||
signal fire_pulse_i : std_logic_vector(ch_num-1 downto 0);
|
||||
signal src_sel : std_logic_vector(1 downto 0);
|
||||
signal ch_pd, ch_pulse_out : std_logic_vector(ch_num - 1 downto 0);
|
||||
signal ch_raw_pulse, ch_mask : std_logic_vector(ch_num - 1 downto 0);
|
||||
signal fire_pulse_i : std_logic_vector(ch_num - 1 downto 0);
|
||||
signal src_sel : std_logic_vector(1 downto 0);
|
||||
--
|
||||
signal one_pps : std_logic;
|
||||
signal ext_fp_det : std_logic_vector(15 downto 0);
|
||||
signal ext_fp_gen : std_logic_vector(15 downto 0);
|
||||
signal pof_rx_regen : std_logic;
|
||||
signal one_pps : std_logic;
|
||||
signal ext_fp_det : std_logic_vector(15 downto 0);
|
||||
signal ext_fp_gen : std_logic_vector(15 downto 0);
|
||||
signal pof_rx_regen : std_logic;
|
||||
|
||||
begin
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- Synchronize the input reset (h2f_reset) to the clock (from PLL)
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
iSyncReset : entity work.sync_reset
|
||||
port map (
|
||||
async_rstN => reset_n,
|
||||
clk => clk,
|
||||
sync_rstN => reset_n_i);
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- C&S Register Interface Splitting
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
iCS_BUS_ITF: entity work.cs_bus_ift_1
|
||||
generic map (
|
||||
blk_num => blk_num)
|
||||
port map (
|
||||
rstN => reset_n_i,
|
||||
clk => clk,
|
||||
avs_address => avs_address(14 downto 0),
|
||||
avs_write => avs_write,
|
||||
avs_writedata => avs_writedata,
|
||||
avs_read => avs_read,
|
||||
avs_readdatavalid => avs_readdatavalid,
|
||||
avs_readdata => avs_readdata,
|
||||
cs_addr => cs_addr,
|
||||
cs_we => cs_write_en,
|
||||
cs_wr_data => cs_write_data,
|
||||
cs_re => cs_read_en,
|
||||
cs_rv => cs_read_valid,
|
||||
cs_rd_data => cs_read_data);
|
||||
|
||||
cs_ctrl_write_en <= cs_write_en(fp_ctrl_id);
|
||||
cs_pg_write_en_g : for i in 1 to ch_num generate
|
||||
cs_pg_write_en(i-1) <= cs_write_en(pg_ch_id+i-1);
|
||||
end generate;
|
||||
cs_nsnk_write_en <= cs_write_en(net_snk_id);
|
||||
cs_log_write_en <= cs_write_en(log_blk_id);
|
||||
cs_ie_write_en <= cs_write_en(int_enc_id);
|
||||
|
||||
cs_ctrl_read_en <= cs_read_en(fp_ctrl_id);
|
||||
cs_pg_read_en_g : for i in 1 to ch_num generate
|
||||
cs_pg_read_en(i-1) <= cs_read_en(pg_ch_id+i-1);
|
||||
end generate;
|
||||
cs_nsnk_read_en <= cs_read_en(net_snk_id);
|
||||
cs_log_read_en <= cs_read_en(log_blk_id);
|
||||
cs_ie_read_en <= cs_read_en(int_enc_id);
|
||||
|
||||
cs_read_valid(fp_ctrl_id) <= cs_ctrl_read_valid;
|
||||
cs_read_valid_pg_g : for i in 1 to ch_num generate
|
||||
cs_read_valid(pg_ch_id+i-1) <= cs_pg_read_valid(i-1);
|
||||
end generate;
|
||||
cs_read_valid(net_snk_id) <= cs_nsnk_read_valid;
|
||||
cs_read_valid(log_blk_id) <= cs_log_read_valid;
|
||||
cs_read_valid(int_enc_id) <= cs_ie_read_valid;
|
||||
|
||||
cs_read_data(31+32*fp_ctrl_id downto 32*fp_ctrl_id) <= cs_ctrl_read_data;
|
||||
cs_read_data_pg_g : for i in 1 to ch_num generate
|
||||
cs_read_data(31+32*(pg_ch_id+i-1) downto 32*(pg_ch_id+i-1)) <= cs_pg_read_data(31+32*(i-1) downto 32*(i-1));
|
||||
end generate;
|
||||
cs_read_data(31+32*net_snk_id downto 32*net_snk_id) <= cs_nsnk_read_data;
|
||||
cs_read_data(31+32*log_blk_id downto 32*log_blk_id) <= cs_log_read_data;
|
||||
cs_read_data(31+32*int_enc_id downto 32*int_enc_id) <= cs_ie_read_data;
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- Fire-Pulse-Manager Controller
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
iCTRL: entity work.fire_pulse_ctrl_1
|
||||
port map (
|
||||
reset_n => reset_n_i,
|
||||
clk => clk,
|
||||
src_sel => src_sel,
|
||||
uart_regen_bypass => uart_regen_bypass,
|
||||
upd_max_pos => upd_max_pos,
|
||||
upd_min_pos => upd_min_pos,
|
||||
enable_rx => enable_rx,
|
||||
uart_bit_div => bit_div,
|
||||
error_rate_thres => error_rate_thres,
|
||||
max_error_flag => max_error_flag,
|
||||
rx_watchdog => rx_watchdog,
|
||||
rx_watchdog_en => rx_watchdog_en,
|
||||
rx_watchdog_clr => rx_watchdog_clr,
|
||||
parity_err_cnt => parity_err_cnt,
|
||||
skip_pos_cnt => skip_pos_cnt,
|
||||
mon_point_src => mon_point_src,
|
||||
mon_points => mon_pt,
|
||||
coarse_time => coarse_time,
|
||||
fine_time => fine_time,
|
||||
one_pps => one_pps,
|
||||
ext_fp_det => ext_fp_det,
|
||||
ext_fp_gen => ext_fp_gen,
|
||||
ins_fpm_irq_0 => ins_fpm_irq_0,
|
||||
avs_address => cs_addr(3 downto 0),
|
||||
avs_write => cs_ctrl_write_en,
|
||||
avs_writedata => cs_write_data,
|
||||
avs_read => cs_ctrl_read_en,
|
||||
avs_readdatavalid => cs_ctrl_read_valid,
|
||||
avs_readdata => cs_ctrl_read_data);
|
||||
|
||||
-- Output multiplexer
|
||||
fire_pulse_i <= ch_pulse_out when src_sel(0) = '1' else (others => pof_rx_regen);
|
||||
fire_pulse <= fire_pulse_i;
|
||||
|
||||
pd_pulse <= pd_pulse_pof when src_sel(1) = '0' else pd_pulse_ie;
|
||||
enc_pulse <= enc_pulse_pof when src_sel(1) = '0' else enc_pulse_ie;
|
||||
abs_pos <= abs_pos_pof when src_sel(1) = '0' else abs_pos_ie(31 downto 0);
|
||||
inc_pos <= inc_pos_pof when src_sel(1) = '0' else inc_pos_ie;
|
||||
dec_pos <= dec_pos_pof when src_sel(1) = '0' else dec_pos_ie;
|
||||
|
||||
mon_point_src( 0) <= remote_init;
|
||||
mon_point_src( 1) <= dp_dir(0);
|
||||
mon_point_src( 2) <= pd_pulse;
|
||||
mon_point_src( 3) <= enc_pulse;
|
||||
mon_point_src( 4) <= ch_pd(0);
|
||||
mon_point_src( 5) <= ch_pulse_out(0);
|
||||
mon_point_src( 6) <= ch_raw_pulse(0);
|
||||
mon_point_src( 7) <= ch_mask(0);
|
||||
mon_point_src( 8) <= pof_rx;
|
||||
mon_point_src( 9) <= fire_pulse_i(0);
|
||||
--
|
||||
mon_point_src(15 downto 10) <= (others => '0');
|
||||
|
||||
pof_iso_en <= enable_rx;
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- Pulse Generator
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
pulse_generator_g : for i in 1 to ch_num generate
|
||||
iCH_PG: entity work.pulse_generator_1
|
||||
generic map(
|
||||
out_pulse_condition => true)
|
||||
port map (
|
||||
clk => clk,
|
||||
reset_n => reset_n_i,
|
||||
init => remote_init,
|
||||
pd_in => pd_pulse,
|
||||
abs_position => abs_pos,
|
||||
dp_dir => dp_dir(i-1),
|
||||
pulse_out => ch_pulse_out(i-1),
|
||||
ch_pd => ch_pd(i-1),
|
||||
ch_mask => ch_mask(i-1),
|
||||
raw_pulse_out => ch_raw_pulse(i-1),
|
||||
enc_pulse => open,
|
||||
avs_address => cs_addr(9 downto 0),
|
||||
avs_write => cs_pg_write_en(i-1),
|
||||
avs_writedata => cs_write_data,
|
||||
avs_read => cs_pg_read_en(i-1),
|
||||
avs_readdatavalid => cs_pg_read_valid(i-1),
|
||||
avs_readdata => cs_pg_read_data(31+32*(i-1) downto 32*(i-1)));
|
||||
iCH_PG : entity work.pulse_generator_1
|
||||
generic map(
|
||||
PD_QUEUE_SIZE => 64, -- make default explicit
|
||||
PULSE_DELAY_EQUAL_EN => true, -- make default explicit
|
||||
OUT_PULSE_CONDITION => true)
|
||||
port map(
|
||||
clk => clk,
|
||||
reset_n => reset_n_i,
|
||||
init => remote_init,
|
||||
pd_in => pd_pulse,
|
||||
abs_position => abs_pos,
|
||||
dp_dir => dp_dir(i - 1),
|
||||
pulse_out => ch_pulse_out(i - 1),
|
||||
filtered_pd => open,
|
||||
ch_pd => ch_pd(i - 1),
|
||||
ch_mask => ch_mask(i - 1),
|
||||
raw_pulse_out => ch_raw_pulse(i - 1),
|
||||
enc_pulse => open,
|
||||
avs_address => cs_addr(9 downto 0),
|
||||
avs_write => cs_pg_write_en(i - 1),
|
||||
avs_writedata => cs_write_data,
|
||||
avs_read => cs_pg_read_en(i - 1),
|
||||
avs_readdatavalid => cs_pg_read_valid(i - 1),
|
||||
avs_readdata => cs_pg_read_data(31 + 32 * (i - 1) downto 32 * (i - 1)));
|
||||
end generate;
|
||||
-----------------------------------------------------------------------------
|
||||
-- POF Interface
|
||||
|
|
@ -291,37 +168,37 @@ begin
|
|||
|
||||
-- POF Receiver
|
||||
iPOF_RX : entity work.pof_rx_1
|
||||
port map (
|
||||
reset_n => reset_n_i,
|
||||
clk => clk,
|
||||
init => '0',
|
||||
rx_clk => rx_clk,
|
||||
rx_data => pof_rx,
|
||||
init_out => remote_init,
|
||||
dp_dir => dp_dir(0),
|
||||
enc_out => enc_pulse_pof,
|
||||
pd_out => pd_pulse_pof,
|
||||
inc_pos => inc_pos_pof,
|
||||
dec_pos => dec_pos_pof,
|
||||
abs_pos => abs_pos_pof,
|
||||
enable => enable_rx,
|
||||
bit_div => bit_div,
|
||||
error_rate_thres => error_rate_thres,
|
||||
one_pps => one_pps,
|
||||
upd_max_pos => upd_max_pos,
|
||||
upd_min_pos => upd_min_pos,
|
||||
max_error_flag => max_error_flag,
|
||||
rx_watchdog => rx_watchdog,
|
||||
rx_watchdog_en => rx_watchdog_en,
|
||||
rx_watchdog_clr => rx_watchdog_clr,
|
||||
parity_err_cnt => parity_err_cnt,
|
||||
skip_pos_cnt => skip_pos_cnt);
|
||||
port map(
|
||||
reset_n => reset_n_i,
|
||||
clk => clk,
|
||||
init => '0',
|
||||
rx_clk => rx_clk,
|
||||
rx_data => pof_rx,
|
||||
init_out => remote_init,
|
||||
dp_dir => dp_dir(0),
|
||||
enc_out => enc_pulse_pof,
|
||||
pd_out => pd_pulse_pof,
|
||||
inc_pos => inc_pos_pof,
|
||||
dec_pos => dec_pos_pof,
|
||||
abs_pos => abs_pos_pof,
|
||||
enable => enable_rx,
|
||||
bit_div => bit_div,
|
||||
error_rate_thres => error_rate_thres,
|
||||
one_pps => one_pps,
|
||||
upd_max_pos => upd_max_pos,
|
||||
upd_min_pos => upd_min_pos,
|
||||
max_error_flag => max_error_flag,
|
||||
rx_watchdog => rx_watchdog,
|
||||
rx_watchdog_en => rx_watchdog_en,
|
||||
rx_watchdog_clr => rx_watchdog_clr,
|
||||
parity_err_cnt => parity_err_cnt,
|
||||
skip_pos_cnt => skip_pos_cnt);
|
||||
|
||||
-- UART signal regeneration
|
||||
iUART_REGEN : entity work.uart_regen_1
|
||||
generic map (
|
||||
generic map(
|
||||
data_width => 8)
|
||||
port map (
|
||||
port map(
|
||||
reset_n => reset_n,
|
||||
clk => rx_clk,
|
||||
bit_div => bit_div,
|
||||
|
|
@ -335,25 +212,25 @@ begin
|
|||
-----------------------------------------------------------------------------
|
||||
|
||||
fire_pulse_ext_i : entity work.fire_pulse_ext_1
|
||||
port map (
|
||||
reset_n => reset_n_i,
|
||||
clk => clk,
|
||||
port map(
|
||||
reset_n => reset_n_i,
|
||||
clk => clk,
|
||||
|
||||
ext_fp_det => ext_fp_det,
|
||||
ext_fp_gen => ext_fp_gen,
|
||||
ext_fp_det => ext_fp_det,
|
||||
ext_fp_gen => ext_fp_gen,
|
||||
|
||||
ext_in => pof_rx,
|
||||
ext_out => pof_rx_regen
|
||||
);
|
||||
ext_in => pof_rx,
|
||||
ext_out => pof_rx_regen
|
||||
);
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- Internal encoder generator
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
iEMUL: entity work.enc_pd_emul_1
|
||||
generic map (
|
||||
iEMUL : entity work.enc_pd_emul_1
|
||||
generic map(
|
||||
SEQ_ENABLE => false)
|
||||
port map (
|
||||
port map(
|
||||
clk => clk,
|
||||
reset_n => reset_n_i,
|
||||
ttl_pd => open,
|
||||
|
|
@ -376,33 +253,163 @@ begin
|
|||
avs_readdata => cs_ie_read_data);
|
||||
|
||||
enc_pulse_ie <= inc_pos_ie when dp_dir(0) = '0' else dec_pos_ie;
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- NetSync Sink
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
-- Not instantiated yet
|
||||
pNSNK_RD_VALID : process(clk)
|
||||
begin
|
||||
if(clk = '1' and clk'event) then
|
||||
cs_nsnk_read_valid <= cs_nsnk_read_en;
|
||||
end if;
|
||||
end process pNSNK_RD_VALID;
|
||||
|
||||
cs_nsnk_read_data <= X"DEAD_BEEF";
|
||||
gInfrastructure : if true generate
|
||||
-----------------------------------------------------------------------------
|
||||
-- Synchronize the input reset (h2f_reset) to the clock (from PLL)
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- Event Logger
|
||||
-----------------------------------------------------------------------------
|
||||
iSyncReset : entity work.sync_reset
|
||||
port map(
|
||||
async_rstN => reset_n,
|
||||
clk => clk,
|
||||
sync_rstN => reset_n_i);
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- C&S Register Interface Splitting
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
iCS_BUS_ITF : entity work.cs_bus_ift_1
|
||||
generic map(
|
||||
blk_num => blk_num)
|
||||
port map(
|
||||
rstN => reset_n_i,
|
||||
clk => clk,
|
||||
avs_address => avs_address(14 downto 0),
|
||||
avs_write => avs_write,
|
||||
avs_writedata => avs_writedata,
|
||||
avs_read => avs_read,
|
||||
avs_readdatavalid => avs_readdatavalid,
|
||||
avs_readdata => avs_readdata,
|
||||
cs_addr => cs_addr,
|
||||
cs_we => cs_write_en,
|
||||
cs_wr_data => cs_write_data,
|
||||
cs_re => cs_read_en,
|
||||
cs_rv => cs_read_valid,
|
||||
cs_rd_data => cs_read_data);
|
||||
|
||||
cs_ctrl_write_en <= cs_write_en(fp_ctrl_id);
|
||||
cs_pg_write_en_g : for i in 1 to ch_num generate
|
||||
cs_pg_write_en(i - 1) <= cs_write_en(pg_ch_id + i - 1);
|
||||
end generate;
|
||||
cs_nsnk_write_en <= cs_write_en(net_snk_id);
|
||||
cs_log_write_en <= cs_write_en(log_blk_id);
|
||||
cs_ie_write_en <= cs_write_en(int_enc_id);
|
||||
|
||||
cs_ctrl_read_en <= cs_read_en(fp_ctrl_id);
|
||||
cs_pg_read_en_g : for i in 1 to ch_num generate
|
||||
cs_pg_read_en(i - 1) <= cs_read_en(pg_ch_id + i - 1);
|
||||
end generate;
|
||||
cs_nsnk_read_en <= cs_read_en(net_snk_id);
|
||||
cs_log_read_en <= cs_read_en(log_blk_id);
|
||||
cs_ie_read_en <= cs_read_en(int_enc_id);
|
||||
|
||||
cs_read_valid(fp_ctrl_id) <= cs_ctrl_read_valid;
|
||||
cs_read_valid_pg_g : for i in 1 to ch_num generate
|
||||
cs_read_valid(pg_ch_id + i - 1) <= cs_pg_read_valid(i - 1);
|
||||
end generate;
|
||||
cs_read_valid(net_snk_id) <= cs_nsnk_read_valid;
|
||||
cs_read_valid(log_blk_id) <= cs_log_read_valid;
|
||||
cs_read_valid(int_enc_id) <= cs_ie_read_valid;
|
||||
|
||||
cs_read_data(31 + 32 * fp_ctrl_id downto 32 * fp_ctrl_id) <= cs_ctrl_read_data;
|
||||
cs_read_data_pg_g : for i in 1 to ch_num generate
|
||||
cs_read_data(31 + 32 * (pg_ch_id + i - 1) downto 32 * (pg_ch_id + i - 1)) <= cs_pg_read_data(31 + 32 * (i - 1) downto 32 * (i - 1));
|
||||
end generate;
|
||||
cs_read_data(31 + 32 * net_snk_id downto 32 * net_snk_id) <= cs_nsnk_read_data;
|
||||
cs_read_data(31 + 32 * log_blk_id downto 32 * log_blk_id) <= cs_log_read_data;
|
||||
cs_read_data(31 + 32 * int_enc_id downto 32 * int_enc_id) <= cs_ie_read_data;
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- Fire-Pulse-Manager Controller
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
iCTRL : entity work.fire_pulse_ctrl_1
|
||||
port map(
|
||||
reset_n => reset_n_i,
|
||||
clk => clk,
|
||||
src_sel => src_sel,
|
||||
uart_regen_bypass => uart_regen_bypass,
|
||||
upd_max_pos => upd_max_pos,
|
||||
upd_min_pos => upd_min_pos,
|
||||
enable_rx => enable_rx,
|
||||
uart_bit_div => bit_div,
|
||||
error_rate_thres => error_rate_thres,
|
||||
max_error_flag => max_error_flag,
|
||||
rx_watchdog => rx_watchdog,
|
||||
rx_watchdog_en => rx_watchdog_en,
|
||||
rx_watchdog_clr => rx_watchdog_clr,
|
||||
parity_err_cnt => parity_err_cnt,
|
||||
skip_pos_cnt => skip_pos_cnt,
|
||||
mon_point_src => mon_point_src,
|
||||
mon_points => mon_pt,
|
||||
coarse_time => coarse_time,
|
||||
fine_time => fine_time,
|
||||
one_pps => one_pps,
|
||||
ext_fp_det => ext_fp_det,
|
||||
ext_fp_gen => ext_fp_gen,
|
||||
ins_fpm_irq_0 => ins_fpm_irq_0,
|
||||
avs_address => cs_addr(3 downto 0),
|
||||
avs_write => cs_ctrl_write_en,
|
||||
avs_writedata => cs_write_data,
|
||||
avs_read => cs_ctrl_read_en,
|
||||
avs_readdatavalid => cs_ctrl_read_valid,
|
||||
avs_readdata => cs_ctrl_read_data);
|
||||
|
||||
-- Output multiplexer
|
||||
fire_pulse_i <= ch_pulse_out when src_sel(0) = '1' else (others => pof_rx_regen);
|
||||
fire_pulse <= fire_pulse_i;
|
||||
|
||||
pd_pulse <= pd_pulse_pof when src_sel(1) = '0' else pd_pulse_ie;
|
||||
enc_pulse <= enc_pulse_pof when src_sel(1) = '0' else enc_pulse_ie;
|
||||
abs_pos <= abs_pos_pof when src_sel(1) = '0' else abs_pos_ie(31 downto 0);
|
||||
inc_pos <= inc_pos_pof when src_sel(1) = '0' else inc_pos_ie;
|
||||
dec_pos <= dec_pos_pof when src_sel(1) = '0' else dec_pos_ie;
|
||||
|
||||
mon_point_src(0) <= remote_init;
|
||||
mon_point_src(1) <= dp_dir(0);
|
||||
mon_point_src(2) <= pd_pulse;
|
||||
mon_point_src(3) <= enc_pulse;
|
||||
mon_point_src(4) <= ch_pd(0);
|
||||
mon_point_src(5) <= ch_pulse_out(0);
|
||||
mon_point_src(6) <= ch_raw_pulse(0);
|
||||
mon_point_src(7) <= ch_mask(0);
|
||||
mon_point_src(8) <= pof_rx;
|
||||
mon_point_src(9) <= fire_pulse_i(0);
|
||||
--
|
||||
mon_point_src(15 downto 10) <= (others => '0');
|
||||
|
||||
pof_iso_en <= enable_rx;
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- NetSync Sink
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
-- Not instantiated yet
|
||||
pNSNK_RD_VALID : process(clk)
|
||||
begin
|
||||
if (clk = '1' and clk'event) then
|
||||
cs_nsnk_read_valid <= cs_nsnk_read_en;
|
||||
end if;
|
||||
end process pNSNK_RD_VALID;
|
||||
|
||||
cs_nsnk_read_data <= X"DEAD_BEEF";
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- Event Logger
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
-- Not instantiated yet
|
||||
pLOG_RD_VALID : process(clk)
|
||||
begin
|
||||
if (clk = '1' and clk'event) then
|
||||
cs_log_read_valid <= cs_log_read_en;
|
||||
end if;
|
||||
end process pLOG_RD_VALID;
|
||||
|
||||
cs_log_read_data <= X"DEAD_BEEF";
|
||||
|
||||
end generate gInfrastructure;
|
||||
|
||||
-- Not instantiated yet
|
||||
pLOG_RD_VALID : process(clk)
|
||||
begin
|
||||
if(clk = '1' and clk'event) then
|
||||
cs_log_read_valid <= cs_log_read_en;
|
||||
end if;
|
||||
end process pLOG_RD_VALID;
|
||||
|
||||
cs_log_read_data <= X"DEAD_BEEF";
|
||||
|
||||
end architecture rtl;
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@
|
|||
"minor_number" : {
|
||||
"type" : "c",
|
||||
"bit_len" : "8",
|
||||
"reset" : "0x04",
|
||||
"reset" : "0x05",
|
||||
"description" : "Minor number"
|
||||
},
|
||||
"major_number" : {
|
||||
|
|
|
|||
|
|
@ -32,42 +32,42 @@ use work.pulse_generator_1_pkg.all;
|
|||
|
||||
entity pulse_generator_1 is
|
||||
generic(
|
||||
PD_QUEUE_SIZE : natural range 32 to 1024 := 64;
|
||||
PULSE_DELAY_EQUAL_EN : boolean := true;
|
||||
OUT_PULSE_CONDITION : boolean := true);
|
||||
PD_QUEUE_SIZE : natural range 32 to 1024 := 64;
|
||||
PULSE_DELAY_EQUAL_EN : boolean := true;
|
||||
OUT_PULSE_CONDITION : boolean := true);
|
||||
port(
|
||||
clk : in std_logic;
|
||||
reset_n : in std_logic := '1';
|
||||
clk : in std_logic;
|
||||
reset_n : in std_logic := '1';
|
||||
--
|
||||
init : in std_logic;
|
||||
init : in std_logic;
|
||||
-- Sequencer I/Os
|
||||
pd_in : in std_logic;
|
||||
abs_position : in std_logic_vector(31 downto 0);
|
||||
dp_dir : out std_logic;
|
||||
pulse_out : out std_logic;
|
||||
pd_in : in std_logic;
|
||||
abs_position : in std_logic_vector(31 downto 0);
|
||||
dp_dir : out std_logic;
|
||||
pulse_out : out std_logic;
|
||||
-- diagnostic outputs
|
||||
filtered_pd : out std_logic;
|
||||
ch_pd : out std_logic;
|
||||
ch_mask : out std_logic;
|
||||
raw_pulse_out : out std_logic;
|
||||
enc_pulse : out std_logic;
|
||||
filtered_pd : out std_logic;
|
||||
ch_pd : out std_logic;
|
||||
ch_mask : out std_logic;
|
||||
raw_pulse_out : out std_logic;
|
||||
enc_pulse : out std_logic;
|
||||
-----------------------------------------------------------------------
|
||||
-- Avalon MM Interface
|
||||
-----------------------------------------------------------------------
|
||||
avs_address : in std_logic_vector( 9 downto 0);
|
||||
avs_write : in std_logic;
|
||||
avs_writedata : in std_logic_vector(31 downto 0);
|
||||
avs_read : in std_logic;
|
||||
avs_readdatavalid : out std_logic;
|
||||
avs_readdata : out std_logic_vector(31 downto 0));
|
||||
avs_address : in std_logic_vector(9 downto 0);
|
||||
avs_write : in std_logic;
|
||||
avs_writedata : in std_logic_vector(31 downto 0);
|
||||
avs_read : in std_logic;
|
||||
avs_readdatavalid : out std_logic;
|
||||
avs_readdata : out std_logic_vector(31 downto 0));
|
||||
end entity pulse_generator_1;
|
||||
|
||||
architecture rtl of pulse_generator_1 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"00000104";
|
||||
constant CSR_IP_ID : std_logic_vector(31 downto 0) := x"0000FF13";
|
||||
constant CSR_IP_VER : std_logic_vector(31 downto 0) := x"00000104";
|
||||
|
||||
|
||||
signal init_de, init_qd, enable, loc_pd, pd_queue_error : std_logic;
|
||||
|
|
@ -76,10 +76,10 @@ architecture rtl of pulse_generator_1 is
|
|||
signal ch_mask_i, bypass_ch_ctrl, bypass_delay_equal : std_logic;
|
||||
signal div_pulse, gated_pulse, retimed_pulse, pulse_out_i : std_logic;
|
||||
signal avs_write_i, avs_read_d, avs_read_i, de_queue_error : std_logic;
|
||||
signal cnt_dir, dp_dir_i, ch_mask_d, ch_ctrl_start_req_i : std_logic;
|
||||
signal cnt_dir, dp_dir_i, ch_mask_d, ch_ctrl_start_req_i : std_logic; -- @suppress "signal ch_mask_d is never read" (testbench)
|
||||
signal set_first_pd, pulse_out_ii : std_logic;
|
||||
signal loc_pulse_out_d, loc_pulse, first_pulse, dp_dir_d : std_logic;
|
||||
signal overdrive_rst, overdrv_event, pulse_scale_out : std_logic;
|
||||
signal overdrive_rst, overdrv_event : std_logic;
|
||||
signal start_img_req, start_img_req_d, start_img, start_img_d : std_logic;
|
||||
signal start_img_dd, fire_enable, img_completed : std_logic;
|
||||
signal sw_ctrl_dp_dir, enable_out, ch_ctrl_start_req_d : std_logic;
|
||||
|
|
@ -95,27 +95,27 @@ architecture rtl of pulse_generator_1 is
|
|||
signal div_pulse_i, spitting_enable, spit_pulse : std_logic;
|
||||
signal seq_bus_valid, spit_nco_msb : std_logic;
|
||||
--
|
||||
signal abs_pos_msb_old : std_logic_vector( 1 downto 0);
|
||||
signal ch_ctrl_csr_addr, ch_ctrl_trigger_in : std_logic_vector( 3 downto 0);
|
||||
signal avs_addr : std_logic_vector( 4 downto 0);
|
||||
signal pulse_width, pulse_width_ext, init_v : std_logic_vector( 7 downto 0);
|
||||
signal ch_ctrl_start_addr : std_logic_vector( 7 downto 0);
|
||||
signal ch_ctrl_address : std_logic_vector( 7 downto 0);
|
||||
signal avs_address_i : std_logic_vector( 9 downto 0);
|
||||
signal overdrive_events, overdrive_thres : std_logic_vector(15 downto 0);
|
||||
signal pulse_interval : std_logic_vector(15 downto 0);
|
||||
signal img_size, pixel_cnt : std_logic_vector(23 downto 0);
|
||||
signal ch_ctrl_vector_out : std_logic_vector(23 downto 0);
|
||||
signal ch_offset, ch_delay, avs_readdata_i : std_logic_vector(31 downto 0);
|
||||
signal ch_ctrl_writedata, ch_ctrl_readdata : std_logic_vector(31 downto 0);
|
||||
signal ch_ctrl_csr_writedata : std_logic_vector(31 downto 0);
|
||||
signal ch_ctrl_csr_readdata : std_logic_vector(31 downto 0);
|
||||
signal ch_offset_dir0, ch_offset_dir1 : std_logic_vector(31 downto 0);
|
||||
signal abs_pos_max, abs_pos_min : std_logic_vector(31 downto 0);
|
||||
signal last_pd_pos : std_logic_vector(31 downto 0);
|
||||
signal pd_in_cnt, fire_req_cnt : std_logic_vector(31 downto 0);
|
||||
signal seq_bus_data, spit_nco, spit_nco_inc : std_logic_vector(31 downto 0);
|
||||
signal div_offset, div_ratio : std_logic_vector(33 downto 0);
|
||||
signal abs_pos_msb_old : std_logic_vector(1 downto 0);
|
||||
signal ch_ctrl_csr_addr, ch_ctrl_trigger_in : std_logic_vector(3 downto 0);
|
||||
signal avs_addr : std_logic_vector(4 downto 0);
|
||||
signal pulse_width, pulse_width_ext, init_v : std_logic_vector(7 downto 0);
|
||||
signal ch_ctrl_start_addr : std_logic_vector(7 downto 0);
|
||||
signal ch_ctrl_address : std_logic_vector(7 downto 0);
|
||||
signal avs_address_i : std_logic_vector(9 downto 0);
|
||||
signal overdrive_events, overdrive_thres : std_logic_vector(15 downto 0);
|
||||
signal pulse_interval : std_logic_vector(15 downto 0);
|
||||
signal img_size, pixel_cnt : std_logic_vector(23 downto 0);
|
||||
signal ch_ctrl_vector_out : std_logic_vector(23 downto 0);
|
||||
signal ch_offset, ch_delay, avs_readdata_i : std_logic_vector(31 downto 0);
|
||||
signal ch_ctrl_writedata, ch_ctrl_readdata : std_logic_vector(31 downto 0);
|
||||
signal ch_ctrl_csr_writedata : std_logic_vector(31 downto 0);
|
||||
signal ch_ctrl_csr_readdata : std_logic_vector(31 downto 0);
|
||||
signal ch_offset_dir0, ch_offset_dir1 : std_logic_vector(31 downto 0);
|
||||
signal abs_pos_max, abs_pos_min : std_logic_vector(31 downto 0);
|
||||
signal last_pd_pos : std_logic_vector(31 downto 0);
|
||||
signal pd_in_cnt, fire_req_cnt : std_logic_vector(31 downto 0);
|
||||
signal seq_bus_data, spit_nco, spit_nco_inc : std_logic_vector(31 downto 0);
|
||||
signal div_offset, div_ratio : std_logic_vector(33 downto 0);
|
||||
|
||||
begin
|
||||
|
||||
|
|
@ -131,38 +131,38 @@ begin
|
|||
|
||||
gen_filt_pd <= '1' when pd_pulse = '1' and (first_pd = '1' or
|
||||
(dp_dir_i = '0' and close_to_zero = '1' and signed(abs_position) > signed(last_pd_pos)) or
|
||||
(dp_dir_i = '0' and close_to_mid = '1' and unsigned(abs_position) > unsigned(last_pd_pos)) or
|
||||
(dp_dir_i = '0' and close_to_mid = '1' and unsigned(abs_position) > unsigned(last_pd_pos)) or
|
||||
(dp_dir_i = '1' and close_to_zero = '1' and signed(abs_position) < signed(last_pd_pos)) or
|
||||
(dp_dir_i = '1' and close_to_mid = '1' and unsigned(abs_position) < unsigned(last_pd_pos))) else '0';
|
||||
(dp_dir_i = '1' and close_to_mid = '1' and unsigned(abs_position) < unsigned(last_pd_pos))) else '0';
|
||||
|
||||
close_to_zero <= '1' when abs_position(31 downto 30) = "00" or abs_position(31 downto 30) = "11" else '0';
|
||||
close_to_mid <= '1' when abs_position(31 downto 30) = "01" or abs_position(31 downto 30) = "10" else '0';
|
||||
|
||||
set_first_pd <= '1' when init_qd = '1' or (dp_dir_i = '0' and upd_max_pos_i = '1') or (dp_dir_i = '1' and upd_min_pos_i = '1') or rst_jitter = '1' or (mid_cross = '1' and mid_crossed = '0') else '0';
|
||||
|
||||
set_first_pd <= '1' when init_qd = '1' or (dp_dir_i = '0' and upd_max_pos_i = '1') or (dp_dir_i = '1' and upd_min_pos_i = '1') or rst_jitter = '1' or (mid_cross = '1' and mid_crossed = '0') else '0';
|
||||
|
||||
pPD_JITTER_MNG : process(clk)
|
||||
begin
|
||||
if(clk = '1' and clk'event) then
|
||||
pd_in_d <= pd_in;
|
||||
if(set_first_pd = '1') then
|
||||
if (clk = '1' and clk'event) then
|
||||
pd_in_d <= pd_in;
|
||||
if (set_first_pd = '1') then
|
||||
first_pd <= '1';
|
||||
elsif(filt_pd = '1') then
|
||||
elsif (filt_pd = '1') then
|
||||
first_pd <= '0';
|
||||
end if;
|
||||
filt_pd <= gen_filt_pd;
|
||||
filt_pd_d <= filt_pd;
|
||||
if(set_first_pd = '1' or gen_filt_pd = '1') then
|
||||
end if;
|
||||
filt_pd <= gen_filt_pd;
|
||||
filt_pd_d <= filt_pd;
|
||||
if (set_first_pd = '1' or gen_filt_pd = '1') then
|
||||
last_pd_pos <= abs_position;
|
||||
end if;
|
||||
abs_pos_msb_old <= abs_position(31 downto 30);
|
||||
if(init_qd = '1' or zero_cross = '1') then
|
||||
if (init_qd = '1' or zero_cross = '1') then
|
||||
mid_crossed <= '0';
|
||||
elsif(mid_cross = '1') then
|
||||
elsif (mid_cross = '1') then
|
||||
mid_crossed <= '1';
|
||||
end if;
|
||||
end if;
|
||||
end process pPD_JITTER_MNG;
|
||||
|
||||
|
||||
mid_cross <= '1' when (dp_dir_i = '0' and abs_position(31 downto 30) = "10" and abs_pos_msb_old = "01") or (dp_dir_i = '1' and abs_position(31 downto 30) = "01" and abs_pos_msb_old = "10") else '0';
|
||||
zero_cross <= '1' when (dp_dir_i = '0' and abs_position(31 downto 30) = "00" and abs_pos_msb_old = "11") or (dp_dir_i = '1' and abs_position(31 downto 30) = "11" and abs_pos_msb_old = "00") else '0';
|
||||
|
||||
|
|
@ -178,11 +178,11 @@ begin
|
|||
-- next increment of absolute position
|
||||
pLOC_PD_IN : process(clk)
|
||||
begin
|
||||
if(clk = '1' and clk'event) then
|
||||
if (clk = '1' and clk'event) then
|
||||
abs_pos_lsb <= abs_position(0);
|
||||
if(filt_pd = '1' and filt_pd_d = '0') then
|
||||
if (filt_pd = '1' and filt_pd_d = '0') then
|
||||
filt_pd_i <= '1';
|
||||
elsif(init = '1' or (filt_pd = '0' and filt_pd_i = '1' and abs_position(0) /= abs_pos_lsb)) then
|
||||
elsif (init = '1' or (filt_pd = '0' and filt_pd_i = '1' and abs_position(0) /= abs_pos_lsb)) then
|
||||
filt_pd_i <= '0';
|
||||
end if;
|
||||
end if;
|
||||
|
|
@ -190,11 +190,11 @@ begin
|
|||
|
||||
-- Note on the maximum size of queue: long PD queues must be taken care of at SW
|
||||
-- level, here the size is limited to 128 (on the PMB it was 16)
|
||||
iPD_queue: entity work.queue_and_delay_1
|
||||
generic map (
|
||||
iPD_queue : entity work.queue_and_delay_1
|
||||
generic map(
|
||||
use_ext_time => true,
|
||||
queue_size => 2*PD_QUEUE_SIZE)
|
||||
port map (
|
||||
queue_size => 2 * PD_QUEUE_SIZE)
|
||||
port map(
|
||||
rstN => reset_n,
|
||||
clk => clk,
|
||||
init => init_qd,
|
||||
|
|
@ -207,13 +207,13 @@ begin
|
|||
|
||||
-- make sure the PD queue is always cleared whenever there is a change of direction
|
||||
dir_change <= dp_dir_i xor dp_dir_d;
|
||||
init_qd <= not enable or init or dir_change;
|
||||
init_qd <= not enable or init or dir_change;
|
||||
|
||||
-- channel offset selection
|
||||
pCH_OFF_SEL : process(clk)
|
||||
begin
|
||||
if(clk = '1' and clk'event) then
|
||||
if(dp_dir_i = '0') then
|
||||
if (clk = '1' and clk'event) then
|
||||
if (dp_dir_i = '0') then
|
||||
ch_offset <= ch_offset_dir0;
|
||||
else
|
||||
ch_offset <= ch_offset_dir1;
|
||||
|
|
@ -229,8 +229,8 @@ begin
|
|||
|
||||
pDIR_CHG : process(clk)
|
||||
begin
|
||||
if(clk = '1' and clk'event) then
|
||||
if(bypass_ch_ctrl = '1') then
|
||||
if (clk = '1' and clk'event) then
|
||||
if (bypass_ch_ctrl = '1') then
|
||||
dp_dir_i <= sw_ctrl_dp_dir;
|
||||
else
|
||||
dp_dir_i <= ch_ctrl_vector_out(0);
|
||||
|
|
@ -254,8 +254,8 @@ begin
|
|||
-- - Gating signal (ch_mask)
|
||||
|
||||
i_channel_control : entity work.generic_sequencer_15
|
||||
generic map (
|
||||
TRIGGER_WIDTH => 4,
|
||||
generic map(
|
||||
TRIGGER_WIDTH => 4,
|
||||
VECTOR_WIDTH => 24,
|
||||
BUS_WIDTH => 32,
|
||||
POS_WIDTH => 24,
|
||||
|
|
@ -266,31 +266,31 @@ begin
|
|||
POS_BUS_EN => true,
|
||||
ALU_EN => false,
|
||||
QUEUE_EN => true)
|
||||
port map (
|
||||
clk => clk,
|
||||
reset_n => reset_n,
|
||||
avs_csr_address => ch_ctrl_csr_addr,
|
||||
avs_csr_write => ch_ctrl_csr_write,
|
||||
avs_csr_writedata => ch_ctrl_csr_writedata,
|
||||
avs_csr_read => ch_ctrl_csr_read,
|
||||
avs_csr_readdata => ch_ctrl_csr_readdata,
|
||||
avs_seq_address => ch_ctrl_address,
|
||||
avs_seq_write => ch_ctrl_write,
|
||||
avs_seq_writedata => ch_ctrl_writedata,
|
||||
avs_seq_read => ch_ctrl_read,
|
||||
avs_seq_readdata => ch_ctrl_readdata,
|
||||
start_req => ch_ctrl_start_req,
|
||||
start_addr => ch_ctrl_start_addr,
|
||||
trigger_in => ch_ctrl_trigger_in,
|
||||
pos_in => abs_position(23 downto 0),
|
||||
busy => ch_ctrl_busy,
|
||||
vector_out => ch_ctrl_vector_out,
|
||||
bus_data => seq_bus_data,
|
||||
bus_valid => seq_bus_valid,
|
||||
bus_ack => '1');
|
||||
port map(
|
||||
clk => clk,
|
||||
reset_n => reset_n,
|
||||
avs_csr_address => ch_ctrl_csr_addr,
|
||||
avs_csr_write => ch_ctrl_csr_write,
|
||||
avs_csr_writedata => ch_ctrl_csr_writedata,
|
||||
avs_csr_read => ch_ctrl_csr_read,
|
||||
avs_csr_readdata => ch_ctrl_csr_readdata,
|
||||
avs_seq_address => ch_ctrl_address,
|
||||
avs_seq_write => ch_ctrl_write,
|
||||
avs_seq_writedata => ch_ctrl_writedata,
|
||||
avs_seq_read => ch_ctrl_read,
|
||||
avs_seq_readdata => ch_ctrl_readdata,
|
||||
start_req => ch_ctrl_start_req,
|
||||
start_addr => ch_ctrl_start_addr,
|
||||
trigger_in => ch_ctrl_trigger_in,
|
||||
pos_in => abs_position(23 downto 0),
|
||||
busy => ch_ctrl_busy,
|
||||
vector_out => ch_ctrl_vector_out,
|
||||
bus_data => seq_bus_data,
|
||||
bus_valid => seq_bus_valid,
|
||||
bus_ack => '1');
|
||||
|
||||
ch_ctrl_trigger_in <= (0 => loc_pd, 1 => fire_enable, 2 => gated_pulse, 3 => (not fire_enable));
|
||||
|
||||
|
||||
ch_mask_i <= fire_enable or ch_ctrl_vector_out(1) or bypass_ch_ctrl;
|
||||
|
||||
-- output to the monitoring point/event-logger
|
||||
|
|
@ -304,60 +304,60 @@ begin
|
|||
--clock cycle
|
||||
|
||||
ch_ctrl_start_req_i <= ch_ctrl_start_req_ii and enable and not init;
|
||||
ch_ctrl_start_req <= ch_ctrl_start_req_i and not ch_ctrl_start_req_d;
|
||||
ch_ctrl_start_req <= ch_ctrl_start_req_i and not ch_ctrl_start_req_d;
|
||||
|
||||
pGEN_IMAGE: process(clk)
|
||||
pGEN_IMAGE : process(clk)
|
||||
begin
|
||||
if(clk = '1' and clk'event) then
|
||||
if (clk = '1' and clk'event) then
|
||||
ch_ctrl_start_req_d <= ch_ctrl_start_req_i;
|
||||
start_img_req_d <= start_img_req;
|
||||
start_img_d <= start_img;
|
||||
start_img_dd <= start_img_d;
|
||||
add_img_size_d <= add_img_size;
|
||||
if(img_completed = '1' or enable = '0' or abort_fire = '1') then
|
||||
start_img_req_d <= start_img_req;
|
||||
start_img_d <= start_img;
|
||||
start_img_dd <= start_img_d;
|
||||
add_img_size_d <= add_img_size;
|
||||
if (img_completed = '1' or enable = '0' or abort_fire = '1') then
|
||||
fire_enable <= '0';
|
||||
elsif(start_img_dd = '1' and fire_enable = '0') then
|
||||
elsif (start_img_dd = '1' and fire_enable = '0') then
|
||||
fire_enable <= '1';
|
||||
end if;
|
||||
if(start_img = '1' and fire_enable = '0') then
|
||||
img_size <= X"00" & ch_ctrl_vector_out(23 downto 8);
|
||||
elsif(add_img_size = '1' and add_img_size_d = '0') then
|
||||
img_size <= std_logic_vector(unsigned(img_size)+unsigned(ch_ctrl_vector_out(23 downto 8)));
|
||||
if (start_img = '1' and fire_enable = '0') then
|
||||
img_size <= X"00" & ch_ctrl_vector_out(23 downto 8);
|
||||
elsif (add_img_size = '1' and add_img_size_d = '0') then
|
||||
img_size <= std_logic_vector(unsigned(img_size) + unsigned(ch_ctrl_vector_out(23 downto 8)));
|
||||
end if;
|
||||
if(start_img = '1' and fire_enable = '0') then
|
||||
pixel_cnt <= (others => '0');
|
||||
elsif(fire_enable = '1' and div_pulse = '1') then
|
||||
pixel_cnt <= std_logic_vector(unsigned(pixel_cnt)+1);
|
||||
if (start_img = '1' and fire_enable = '0') then
|
||||
pixel_cnt <= (others => '0');
|
||||
elsif (fire_enable = '1' and div_pulse = '1') then
|
||||
pixel_cnt <= std_logic_vector(unsigned(pixel_cnt) + 1);
|
||||
end if;
|
||||
end if;
|
||||
end process pGEN_IMAGE;
|
||||
|
||||
start_img <= start_img_req and not start_img_req_d;
|
||||
start_img <= start_img_req and not start_img_req_d;
|
||||
img_completed <= '1' when fire_enable = '1' and unsigned(pixel_cnt) = unsigned(img_size) else '0';
|
||||
|
||||
-- DO NOT REMOVE: USED BY THE TESTBENCH!
|
||||
-- synthesis translate_off
|
||||
p_ch_mask_d : process(clk)
|
||||
begin
|
||||
if(clk = '1' and clk'event) then
|
||||
if (clk = '1' and clk'event) then
|
||||
ch_mask_d <= ch_mask_i;
|
||||
end if;
|
||||
end process p_ch_mask_d;
|
||||
-- synthesis translate_on
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- Fractional Divider
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
iFracDiv : entity work.simple_frac_div_1
|
||||
port map (
|
||||
port map(
|
||||
clk => clk,
|
||||
enable => frac_div_en,
|
||||
dir => dp_dir_i,
|
||||
upd_max_pos => upd_max_pos,
|
||||
upd_min_pos => upd_min_pos,
|
||||
abs_pos_max => abs_pos_max,
|
||||
abs_pos_min => abs_pos_min,
|
||||
dir => dp_dir_i,
|
||||
offset => div_offset,
|
||||
ratio => div_ratio,
|
||||
abs_pos => abs_position,
|
||||
|
|
@ -373,7 +373,7 @@ begin
|
|||
|
||||
p_pulse_div_switch : process(clk)
|
||||
begin
|
||||
if(clk = '1' and clk'event) then
|
||||
if (clk = '1' and clk'event) then
|
||||
rst_jitter <= ch_ctrl_vector_out(5);
|
||||
upd_max_pos <= upd_max_pos_i or init_v(0) or dir_change or (rst_jitter and not dp_dir_i);
|
||||
upd_min_pos <= upd_min_pos_i or init_v(0) or dir_change or (rst_jitter and dp_dir_i);
|
||||
|
|
@ -390,18 +390,18 @@ begin
|
|||
|
||||
pSPITTING_LOGIC : process(clk)
|
||||
begin
|
||||
if(clk = '1' and clk'event) then
|
||||
if (clk = '1' and clk'event) then
|
||||
spitting_enable <= ch_ctrl_vector_out(6);
|
||||
if(seq_bus_valid = '1') then
|
||||
if (seq_bus_valid = '1') then
|
||||
spit_nco_inc <= seq_bus_data;
|
||||
end if;
|
||||
if(spitting_enable = '0') then
|
||||
if (spitting_enable = '0') then
|
||||
spit_nco <= (others => '0');
|
||||
else
|
||||
spit_nco <= std_logic_vector(unsigned(spit_nco)+unsigned(spit_nco_inc));
|
||||
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;
|
||||
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;
|
||||
|
||||
|
|
@ -417,12 +417,12 @@ begin
|
|||
|
||||
-- compendate for variation in the channel delay when daisy-chaining multiple
|
||||
-- EMBs/HMBs:
|
||||
gPULSE_DELAY_EQUAL: if PULSE_DELAY_EQUAL_EN = true generate
|
||||
iDE: entity work.queue_and_delay_1
|
||||
generic map (
|
||||
gPULSE_DELAY_EQUAL : if PULSE_DELAY_EQUAL_EN = true generate
|
||||
iDE : entity work.queue_and_delay_1
|
||||
generic map(
|
||||
use_ext_time => false,
|
||||
queue_size => 256)
|
||||
port map (
|
||||
port map(
|
||||
rstN => reset_n,
|
||||
clk => clk,
|
||||
init => init_de,
|
||||
|
|
@ -437,7 +437,7 @@ begin
|
|||
|
||||
end generate gPULSE_DELAY_EQUAL;
|
||||
|
||||
gNOT_PULSE_DELAY_EQUAL: if PULSE_DELAY_EQUAL_EN = false generate
|
||||
gNOT_PULSE_DELAY_EQUAL : if PULSE_DELAY_EQUAL_EN = false generate
|
||||
|
||||
retimed_pulse <= gated_pulse;
|
||||
|
||||
|
|
@ -447,8 +447,8 @@ begin
|
|||
|
||||
p_delay_equal_switch : process(clk)
|
||||
begin
|
||||
if(clk = '1' and clk'event) then
|
||||
if(bypass_delay_equal = '1') then
|
||||
if (clk = '1' and clk'event) then
|
||||
if (bypass_delay_equal = '1') then
|
||||
pulse_out_i <= gated_pulse;
|
||||
else
|
||||
pulse_out_i <= retimed_pulse;
|
||||
|
|
@ -464,27 +464,27 @@ begin
|
|||
|
||||
pODRV_CHK : process(clk)
|
||||
begin
|
||||
if(clk = '1' and clk'event) then
|
||||
if (clk = '1' and clk'event) then
|
||||
loc_pulse_out_d <= pulse_out_i;
|
||||
if(enable = '0' or overdrive_rst = '1' or unsigned(pulse_interval) = 2**16-1) then
|
||||
if (enable = '0' or overdrive_rst = '1' or unsigned(pulse_interval) = 2**16 - 1) then
|
||||
first_pulse <= '1';
|
||||
elsif(loc_pulse = '1') then
|
||||
elsif (loc_pulse = '1') then
|
||||
first_pulse <= '0';
|
||||
end if;
|
||||
if(loc_pulse = '1') then
|
||||
if (loc_pulse = '1') then
|
||||
pulse_interval <= (others => '0');
|
||||
else
|
||||
pulse_interval <= std_logic_vector(unsigned(pulse_interval)+1);
|
||||
pulse_interval <= std_logic_vector(unsigned(pulse_interval) + 1);
|
||||
end if;
|
||||
if(loc_pulse = '1' and first_pulse = '0' and unsigned(pulse_interval) < unsigned(overdrive_thres)) then
|
||||
if (loc_pulse = '1' and first_pulse = '0' and unsigned(pulse_interval) < unsigned(overdrive_thres)) then
|
||||
overdrv_event <= '1';
|
||||
else
|
||||
overdrv_event <= '0';
|
||||
end if;
|
||||
if(enable = '0' or overdrive_rst = '1') then
|
||||
if (enable = '0' or overdrive_rst = '1') then
|
||||
overdrive_events <= (others => '0');
|
||||
elsif(overdrv_event = '1') then
|
||||
overdrive_events <= std_logic_vector(unsigned(overdrive_events)+1);
|
||||
elsif (overdrv_event = '1') then
|
||||
overdrive_events <= std_logic_vector(unsigned(overdrive_events) + 1);
|
||||
end if;
|
||||
end if;
|
||||
end process pODRV_CHK;
|
||||
|
|
@ -493,10 +493,10 @@ begin
|
|||
-- Pulse Width Conditioning
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
gOUT_COND: if OUT_PULSE_CONDITION = true generate
|
||||
|
||||
iPC: entity work.pulse_conditioning_1
|
||||
port map (
|
||||
gOUT_COND : if OUT_PULSE_CONDITION = true generate
|
||||
|
||||
iPC : entity work.pulse_conditioning_1
|
||||
port map(
|
||||
reset_n => reset_n,
|
||||
clk => clk,
|
||||
enable => enable,
|
||||
|
|
@ -510,7 +510,7 @@ begin
|
|||
fire_req <= pulse_out_ii when bypass_pulse_cond = '0' else pulse_out_i;
|
||||
|
||||
end generate gOUT_COND;
|
||||
|
||||
|
||||
gOUT_BYPASS : if OUT_PULSE_CONDITION = false generate
|
||||
|
||||
pulse_out <= pulse_out_i;
|
||||
|
|
@ -524,22 +524,22 @@ begin
|
|||
|
||||
pEdgeDetect_Cnt : process(clk)
|
||||
begin
|
||||
if(clk = '1' and clk'event) then
|
||||
fire_req_d <= fire_req;
|
||||
if(init = '1' or enable = '0' or rst_diag_regs = '1') then
|
||||
if (clk = '1' and clk'event) then
|
||||
fire_req_d <= fire_req;
|
||||
if (init = '1' or enable = '0' or rst_diag_regs = '1') then
|
||||
pd_in_cnt <= (others => '0');
|
||||
elsif(pd_pulse = '1') then
|
||||
pd_in_cnt <= std_logic_vector(unsigned(pd_in_cnt)+1);
|
||||
elsif (pd_pulse = '1') then
|
||||
pd_in_cnt <= std_logic_vector(unsigned(pd_in_cnt) + 1);
|
||||
end if;
|
||||
if(init = '1' or enable = '0' or rst_diag_regs = '1') then
|
||||
if (init = '1' or enable = '0' or rst_diag_regs = '1') then
|
||||
fire_req_cnt <= (others => '0');
|
||||
elsif(fire_req_p = '1') then
|
||||
fire_req_cnt <= std_logic_vector(unsigned(fire_req_cnt)+1);
|
||||
elsif (fire_req_p = '1') then
|
||||
fire_req_cnt <= std_logic_vector(unsigned(fire_req_cnt) + 1);
|
||||
end if;
|
||||
end if;
|
||||
end process pEdgeDetect_Cnt;
|
||||
|
||||
fire_req_p <= fire_req and not fire_req_d;
|
||||
|
||||
fire_req_p <= fire_req and not fire_req_d;
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- C&S registers (Avalon-MM I/F)
|
||||
|
|
@ -553,12 +553,12 @@ begin
|
|||
ch_ctrl_write <= '1' when avs_write = '1' and avs_address(9) = '1' else '0';
|
||||
ch_ctrl_csr_write <= '1' when avs_write = '1' and avs_address(9 downto 5) = "00001" else '0';
|
||||
|
||||
avs_read_i <= '1' when avs_read = '1' and avs_address(9) = '0' else '0';
|
||||
ch_ctrl_read <= '1' when avs_read = '1' and avs_address(9) = '1' else '0';
|
||||
ch_ctrl_csr_read <= '1' when avs_read = '1' and avs_address(9 downto 5) = "00001" else '0';
|
||||
avs_read_i <= '1' when avs_read = '1' and avs_address(9) = '0' else '0';
|
||||
ch_ctrl_read <= '1' when avs_read = '1' and avs_address(9) = '1' else '0';
|
||||
ch_ctrl_csr_read <= '1' when avs_read = '1' and avs_address(9 downto 5) = "00001" else '0';
|
||||
|
||||
avs_addr <= avs_address(4 downto 0);
|
||||
|
||||
avs_addr <= avs_address(4 downto 0);
|
||||
|
||||
ch_ctrl_address <= avs_address(ch_ctrl_address'range);
|
||||
ch_ctrl_csr_addr <= avs_address(ch_ctrl_csr_addr'range);
|
||||
|
||||
|
|
@ -567,8 +567,8 @@ begin
|
|||
|
||||
pINIT : process(clk)
|
||||
begin
|
||||
if(clk = '1' and clk'event) then
|
||||
if(init = '1') then
|
||||
if (clk = '1' and clk'event) then
|
||||
if (init = '1') then
|
||||
init_v <= (others => '1');
|
||||
else
|
||||
init_v <= '0' & init_v(init_v'high downto 1);
|
||||
|
|
@ -580,86 +580,86 @@ begin
|
|||
|
||||
pCTRL_STATUS : process(reset_n, clk)
|
||||
begin
|
||||
if(reset_n = '0') then
|
||||
avs_read_d <= '0';
|
||||
avs_readdatavalid <= '0';
|
||||
avs_readdata_i <= (others => '0');
|
||||
if (reset_n = '0') then
|
||||
avs_read_d <= '0';
|
||||
avs_readdatavalid <= '0';
|
||||
avs_readdata_i <= (others => '0');
|
||||
--
|
||||
enable_i <= '0';
|
||||
bypass_ch_ctrl <= '0';
|
||||
bypass_pulse_cond <= '0';
|
||||
bypass_delay_equal <= '0';
|
||||
sw_ctrl_dp_dir <= '0';
|
||||
enable_out <= '0';
|
||||
abort_fire <= '0';
|
||||
enable_i <= '0';
|
||||
bypass_ch_ctrl <= '0';
|
||||
bypass_pulse_cond <= '0';
|
||||
bypass_delay_equal <= '0';
|
||||
sw_ctrl_dp_dir <= '0';
|
||||
enable_out <= '0';
|
||||
abort_fire <= '0';
|
||||
--
|
||||
ch_offset_dir0 <= (others => '0');
|
||||
ch_offset_dir1 <= (others => '0');
|
||||
ch_delay <= (others => '0');
|
||||
ch_offset_dir0 <= (others => '0');
|
||||
ch_offset_dir1 <= (others => '0');
|
||||
ch_delay <= (others => '0');
|
||||
--
|
||||
ch_ctrl_start_req_ii <= '0';
|
||||
ch_ctrl_start_addr <= (others => '0');
|
||||
ch_ctrl_start_addr <= (others => '0');
|
||||
--
|
||||
frac_div_en_i <= '0';
|
||||
upd_max_pos_i <= '0';
|
||||
upd_min_pos_i <= '0';
|
||||
frac_div_en_i <= '0';
|
||||
upd_max_pos_i <= '0';
|
||||
upd_min_pos_i <= '0';
|
||||
--
|
||||
pulse_width <= std_logic_vector(to_unsigned(20,8)); -- 200 ns at clk=100MHz
|
||||
pulse_width_ext <= std_logic_vector(to_unsigned(50,8)); -- 500 ns at clk=100MHz
|
||||
pulse_width <= std_logic_vector(to_unsigned(20, 8)); -- 200 ns at clk=100MHz
|
||||
pulse_width_ext <= std_logic_vector(to_unsigned(50, 8)); -- 500 ns at clk=100MHz
|
||||
--
|
||||
overdrive_rst <= '0';
|
||||
overdrive_thres <= std_logic_vector(to_unsigned(100-1,16));
|
||||
overdrive_rst <= '0';
|
||||
overdrive_thres <= std_logic_vector(to_unsigned(100 - 1, 16));
|
||||
--
|
||||
div_offset <= (others => '0');
|
||||
div_ratio <= (others => '0');
|
||||
elsif(clk = '1' and clk'event) then
|
||||
div_offset <= (others => '0');
|
||||
div_ratio <= (others => '0');
|
||||
elsif (clk = '1' and clk'event) then
|
||||
-- CTRL registers
|
||||
if(avs_write_i = '1' and avs_address(9 downto 4) = "000000") then
|
||||
if (avs_write_i = '1' and avs_address(9 downto 4) = "000000") then
|
||||
case avs_addr is
|
||||
when PULSE_GEN_CTRL_REG =>
|
||||
enable_i <= avs_writedata(0);
|
||||
bypass_ch_ctrl <= avs_writedata(1);
|
||||
bypass_pulse_cond <= avs_writedata(2);
|
||||
bypass_delay_equal <= avs_writedata(3);
|
||||
sw_ctrl_dp_dir <= avs_writedata(4);
|
||||
enable_out <= avs_writedata(16);
|
||||
abort_fire <= avs_writedata(17);
|
||||
rst_diag_regs <= avs_writedata(18);
|
||||
enable_i <= avs_writedata(0);
|
||||
bypass_ch_ctrl <= avs_writedata(1);
|
||||
bypass_pulse_cond <= avs_writedata(2);
|
||||
bypass_delay_equal <= avs_writedata(3);
|
||||
sw_ctrl_dp_dir <= avs_writedata(4);
|
||||
enable_out <= avs_writedata(16);
|
||||
abort_fire <= avs_writedata(17);
|
||||
rst_diag_regs <= avs_writedata(18);
|
||||
when CH_OFFSET_D0_REG =>
|
||||
ch_offset_dir0 <= avs_writedata;
|
||||
ch_offset_dir0 <= avs_writedata;
|
||||
when CH_DELAY_REG =>
|
||||
ch_delay <= avs_writedata;
|
||||
ch_delay <= avs_writedata;
|
||||
when CH_CTRL_CTRL_REG =>
|
||||
ch_ctrl_start_req_ii <= avs_writedata(0);
|
||||
ch_ctrl_start_addr <= avs_writedata(15 downto 8);
|
||||
ch_ctrl_start_addr <= avs_writedata(15 downto 8);
|
||||
when FRAC_DIV_CTRL_REG =>
|
||||
frac_div_en_i <= avs_writedata(0);
|
||||
upd_max_pos_i <= avs_writedata(1);
|
||||
upd_min_pos_i <= avs_writedata(2);
|
||||
frac_div_en_i <= avs_writedata(0);
|
||||
upd_max_pos_i <= avs_writedata(1);
|
||||
upd_min_pos_i <= avs_writedata(2);
|
||||
when PULSE_WIDTH_REG =>
|
||||
pulse_width <= avs_writedata( 7 downto 0);
|
||||
pulse_width_ext <= avs_writedata(23 downto 16);
|
||||
pulse_width <= avs_writedata(7 downto 0);
|
||||
pulse_width_ext <= avs_writedata(23 downto 16);
|
||||
when OVERDRV_THRES_REG =>
|
||||
overdrive_rst <= avs_writedata(0);
|
||||
overdrive_thres <= avs_writedata(31 downto 16);
|
||||
overdrive_rst <= avs_writedata(0);
|
||||
overdrive_thres <= avs_writedata(31 downto 16);
|
||||
when CH_OFFSET_D1_REG =>
|
||||
ch_offset_dir1 <= avs_writedata;
|
||||
ch_offset_dir1 <= avs_writedata;
|
||||
when DIV_RATIO_INT =>
|
||||
div_ratio(33 downto 24) <= avs_writedata( 9 downto 0);
|
||||
div_ratio(33 downto 24) <= avs_writedata(9 downto 0);
|
||||
when DIV_RATIO_FRAC =>
|
||||
div_ratio(23 downto 0) <= avs_writedata(23 downto 0);
|
||||
div_ratio(23 downto 0) <= avs_writedata(23 downto 0);
|
||||
when SP_OFFSET_INT =>
|
||||
div_offset(33 downto 24) <= avs_writedata( 9 downto 0);
|
||||
div_offset(33 downto 24) <= avs_writedata(9 downto 0);
|
||||
when SP_OFFSET_FRAC =>
|
||||
div_offset(23 downto 0) <= avs_writedata(23 downto 0);
|
||||
div_offset(23 downto 0) <= avs_writedata(23 downto 0);
|
||||
when others => null;
|
||||
end case;
|
||||
end if;
|
||||
|
||||
|
||||
-- Read Ctrl & Status registers
|
||||
avs_read_d <= avs_read;
|
||||
avs_readdatavalid <= avs_read_d;
|
||||
if(avs_read_i = '1') then
|
||||
if (avs_read_i = '1') then
|
||||
case avs_addr is
|
||||
when CSR_IP_ID_ADDR =>
|
||||
avs_readdata_i <= CSR_IP_ID;
|
||||
|
|
@ -667,13 +667,13 @@ begin
|
|||
avs_readdata_i <= CSR_IP_VER;
|
||||
when PULSE_GEN_CTRL_REG =>
|
||||
avs_readdata_i(31 downto 8) <= (8 => ch_mask_i, 9 => fire_enable, 10 => dp_dir, 16 => enable_out, 17 => abort_fire, 18 => rst_diag_regs, others => '0');
|
||||
avs_readdata_i( 7 downto 4) <= b"0" & de_queue_error & pd_queue_error & sw_ctrl_dp_dir;
|
||||
avs_readdata_i( 3 downto 0) <= bypass_delay_equal & bypass_pulse_cond & bypass_ch_ctrl & enable_i;
|
||||
when CH_OFFSET_D0_REG =>
|
||||
avs_readdata_i(7 downto 4) <= b"0" & de_queue_error & pd_queue_error & sw_ctrl_dp_dir;
|
||||
avs_readdata_i(3 downto 0) <= bypass_delay_equal & bypass_pulse_cond & bypass_ch_ctrl & enable_i;
|
||||
when CH_OFFSET_D0_REG =>
|
||||
avs_readdata_i <= ch_offset_dir0;
|
||||
when CH_OFFSET_D1_REG =>
|
||||
when CH_OFFSET_D1_REG =>
|
||||
avs_readdata_i <= ch_offset_dir1;
|
||||
when CH_DELAY_REG =>
|
||||
when CH_DELAY_REG =>
|
||||
avs_readdata_i <= ch_delay;
|
||||
when CH_CTRL_CTRL_REG =>
|
||||
avs_readdata_i <= X"0000" & ch_ctrl_start_addr & X"0" & "00" & ch_ctrl_busy & ch_ctrl_start_req_ii;
|
||||
|
|
@ -682,7 +682,7 @@ begin
|
|||
when PULSE_WIDTH_REG =>
|
||||
avs_readdata_i <= X"00" & pulse_width_ext & X"00" & pulse_width;
|
||||
when OVERDRV_THRES_REG =>
|
||||
avs_readdata_i(15 downto 0) <= (0 => overdrive_rst, others => '0');
|
||||
avs_readdata_i(15 downto 0) <= (0 => overdrive_rst, others => '0');
|
||||
avs_readdata_i(31 downto 16) <= overdrive_thres;
|
||||
when OVERDRV_EVENT_REG =>
|
||||
avs_readdata_i <= X"0000" & overdrive_events;
|
||||
|
|
@ -710,11 +710,11 @@ begin
|
|||
else
|
||||
avs_readdata_i <= X"BAD1BAD0";
|
||||
end if;
|
||||
if(avs_read = '1') then
|
||||
if (avs_read = '1') then
|
||||
avs_address_i <= avs_address;
|
||||
end if;
|
||||
-- output multiplexer
|
||||
case? avs_address_i( 9 downto 5) is
|
||||
case? avs_address_i(9 downto 5) is
|
||||
when "00000" =>
|
||||
avs_readdata <= avs_readdata_i;
|
||||
when "00001" =>
|
||||
|
|
@ -723,8 +723,8 @@ begin
|
|||
avs_readdata <= ch_ctrl_readdata;
|
||||
when others =>
|
||||
avs_readdata <= X"BAD1BAD0";
|
||||
end case?;
|
||||
end case?;
|
||||
end if;
|
||||
end process pCTRL_STATUS;
|
||||
end process pCTRL_STATUS;
|
||||
|
||||
end architecture rtl;
|
||||
|
|
|
|||
|
|
@ -29,48 +29,34 @@ use work.common_pkg.all;
|
|||
|
||||
entity queue_and_delay_1 is
|
||||
generic(
|
||||
use_ext_time : boolean := false;
|
||||
queue_size : natural range 16 to 8192 := 1024);
|
||||
port (
|
||||
rstN : in std_logic;
|
||||
clk : in std_logic;
|
||||
init : in std_logic;
|
||||
cnt_dir : in std_logic; -- specify the direction of the cnt (0 => up, 1
|
||||
-- => down), when use_ext_time is set to ture
|
||||
delay : in std_logic_vector(31 downto 0);
|
||||
ext_time : in std_logic_vector(31 downto 0);
|
||||
wave_in : in std_logic;
|
||||
wave_out : out std_logic;
|
||||
ovf_error : out std_logic);
|
||||
use_ext_time : boolean := false;
|
||||
queue_size : natural range 16 to 8192 := 1024);
|
||||
port(
|
||||
rstN : in std_logic;
|
||||
clk : in std_logic;
|
||||
init : in std_logic;
|
||||
cnt_dir : in std_logic; -- specify the direction of the cnt (0 => up, 1 => down), when use_ext_time is set to ture
|
||||
delay : in std_logic_vector(31 downto 0);
|
||||
ext_time : in std_logic_vector(31 downto 0);
|
||||
wave_in : in std_logic;
|
||||
wave_out : out std_logic;
|
||||
ovf_error : out std_logic);
|
||||
end queue_and_delay_1;
|
||||
|
||||
architecture RTL of queue_and_delay_1 is
|
||||
|
||||
component sync_fifo_1
|
||||
generic (
|
||||
FIFO_WIDTH : natural range 1 to 32;
|
||||
FIFO_DEPTH : natural range 1 to 8192);
|
||||
port (
|
||||
clock : in std_logic;
|
||||
data : in std_logic_vector (FIFO_WIDTH-1 downto 0);
|
||||
rdreq : in std_logic;
|
||||
sclr : in std_logic;
|
||||
wrreq : in std_logic;
|
||||
empty : out std_logic;
|
||||
full : out std_logic;
|
||||
q : out std_logic_vector (FIFO_WIDTH-1 downto 0);
|
||||
usedw : out std_logic_vector (log2(FIFO_DEPTH)-1 downto 0));
|
||||
end component;
|
||||
signal toggle_in, toggle_out, time_elapsed : std_logic;
|
||||
signal wave_in_d, wave_out_i, pending_trans : std_logic;
|
||||
signal fifo_rd_en, fifo_empty, fifo_full : std_logic;
|
||||
signal cnt_dir_i, wave_out_i_d, new_event : std_logic;
|
||||
signal wave_out_ii, shf_enable : std_logic;
|
||||
signal delay_line : std_logic_vector(7 downto 0);
|
||||
signal local_time, local_time_d, event_time : std_logic_vector(31 downto 0);
|
||||
signal internal_time : std_logic_vector(31 downto 0); -- internally generated time when ext_time not being used
|
||||
signal sLocal_time_minus_delay, sLocal_time_plus_delay : signed(local_time'high + 1 downto 0);
|
||||
signal TR1_Local_time_minus_delay : signed(local_time'high + 2 downto 0);
|
||||
|
||||
signal toggle_in, toggle_out,time_elapsed : std_logic;
|
||||
signal wave_in_d, wave_out_i, pending_trans : std_logic;
|
||||
signal fifo_rd_en, fifo_empty, fifo_full : std_logic;
|
||||
signal cnt_dir_i, wave_out_i_d, new_event : std_logic;
|
||||
signal wave_out_ii, shf_enable : std_logic;
|
||||
signal delay_line : std_logic_vector( 7 downto 0);
|
||||
signal local_time, local_time_d, event_time : std_logic_vector(31 downto 0);
|
||||
|
||||
begin -- RTL
|
||||
begin -- RTL
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- Detect transitions in the input signal and memorize those events in a
|
||||
|
|
@ -82,20 +68,20 @@ begin -- RTL
|
|||
|
||||
pInputEdgeDetect : process(clk)
|
||||
begin
|
||||
if(clk = '1' and clk'event) then
|
||||
if (clk = '1' and clk'event) then
|
||||
wave_in_d <= wave_in;
|
||||
end if;
|
||||
end process pInputEdgeDetect;
|
||||
|
||||
iENTRY_QUEUE: sync_fifo_1
|
||||
iENTRY_QUEUE : entity work.sync_fifo_1
|
||||
generic map(
|
||||
FIFO_WIDTH => 32,
|
||||
FIFO_DEPTH => queue_size)
|
||||
port map (
|
||||
port map(
|
||||
sclr => init,
|
||||
clock => clk,
|
||||
data => local_time,
|
||||
rdreq => fifo_rd_en,
|
||||
sclr => init,
|
||||
wrreq => toggle_in,
|
||||
empty => fifo_empty,
|
||||
full => fifo_full,
|
||||
|
|
@ -105,74 +91,82 @@ begin -- RTL
|
|||
-- Check Overflow error:
|
||||
pCHECK_OVF : process(rstN, clk)
|
||||
begin
|
||||
if(rstN = '0') then
|
||||
ovf_error <= '0';
|
||||
elsif(clk = '1' and clk'event) then
|
||||
if(init = '1') then
|
||||
if (rstN = '0') then
|
||||
ovf_error <= '0';
|
||||
elsif (clk = '1' and clk'event) then
|
||||
if (init = '1') then
|
||||
ovf_error <= '0';
|
||||
elsif(toggle_in = '1' and fifo_full = '1') then
|
||||
elsif (toggle_in = '1' and fifo_full = '1') then
|
||||
ovf_error <= '1';
|
||||
end if;
|
||||
end if;
|
||||
end process pCHECK_OVF;
|
||||
end process pCHECK_OVF;
|
||||
|
||||
-- Time reference: either use the external one or generate it locally
|
||||
gTIME_REF0: if use_ext_time = true generate
|
||||
gTIME_REF0 : if use_ext_time = true generate
|
||||
|
||||
pLATCH_LOCTIME : process(clk)
|
||||
begin
|
||||
if(clk = '1' and clk'event) then
|
||||
local_time <= ext_time;
|
||||
if (clk = '1' and clk'event) then
|
||||
local_time <= ext_time;
|
||||
sLocal_time_minus_delay <= resize(signed(ext_time) - signed(delay), sLocal_time_minus_delay'length);
|
||||
sLocal_time_plus_delay <= resize(signed(ext_time) + signed(delay), sLocal_time_plus_delay'length);
|
||||
end if;
|
||||
end process pLATCH_LOCTIME;
|
||||
|
||||
|
||||
shf_enable <= '1' when local_time /= local_time_d else '0';
|
||||
|
||||
--pTimeElapsed : process(cnt_dir, local_time, event_time, delay)
|
||||
pTimeElapsed : process(clk)
|
||||
begin
|
||||
if(clk = '1' and clk'event) then
|
||||
if (clk = '1' and clk'event) then
|
||||
local_time_d <= local_time;
|
||||
cnt_dir_i <= cnt_dir;
|
||||
if(cnt_dir_i = '0') then
|
||||
if(signed(local_time) >= signed(event_time) + signed(delay)) then
|
||||
cnt_dir_i <= cnt_dir;
|
||||
if (cnt_dir_i = '0') then
|
||||
if sLocal_time_minus_delay >= resize(signed(event_time), sLocal_time_minus_delay'length) then
|
||||
time_elapsed <= '1';
|
||||
else
|
||||
time_elapsed <= '0';
|
||||
end if;
|
||||
else
|
||||
if(signed(local_time) <= signed(event_time) - signed(delay)) then
|
||||
if sLocal_time_plus_delay <= resize(signed(event_time), sLocal_time_plus_delay'length) then
|
||||
time_elapsed <= '1';
|
||||
else
|
||||
time_elapsed <= '0';
|
||||
end if;
|
||||
end if;
|
||||
new_event <= fifo_rd_en;
|
||||
new_event <= fifo_rd_en;
|
||||
end if;
|
||||
end process pTimeElapsed;
|
||||
|
||||
|
||||
|
||||
end generate gTIME_REF0;
|
||||
|
||||
gTIME_REF1: if use_ext_time = false generate
|
||||
gTIME_REF1 : if use_ext_time = false generate
|
||||
|
||||
pGEN_LOC_REF : process(rstN, clk)
|
||||
begin
|
||||
if(rstN = '0') then
|
||||
local_time <= (others => '0');
|
||||
elsif(clk = '1' and clk'event) then
|
||||
if(init = '1') then
|
||||
local_time <= (others => '0');
|
||||
if (rstN = '0') then
|
||||
internal_time <= (others => '0');
|
||||
local_time <= (others => '0');
|
||||
TR1_Local_time_minus_delay <= (others => '0');
|
||||
elsif (clk = '1' and clk'event) then
|
||||
local_time <= internal_time;
|
||||
--TODO check that this still works - Q&D test bench?
|
||||
TR1_Local_time_minus_delay <= resize(signed(b"0" & internal_time) - signed(b"0" & delay), TR1_Local_time_minus_delay'length);
|
||||
if (init = '1') then
|
||||
internal_time <= (others => '0');
|
||||
else
|
||||
local_time <= std_logic_vector(unsigned(local_time)+1);
|
||||
internal_time <= std_logic_vector(unsigned(internal_time) + 1);
|
||||
end if;
|
||||
end if;
|
||||
end process pGEN_LOC_REF;
|
||||
|
||||
new_event <= fifo_rd_en;
|
||||
time_elapsed <= '1' when unsigned(local_time) >= unsigned(event_time) + unsigned(delay) else '0';
|
||||
new_event <= fifo_rd_en;
|
||||
time_elapsed <= '1' when TR1_Local_time_minus_delay >= signed(resize(unsigned(event_time), TR1_Local_time_minus_delay'length)) else '0';
|
||||
|
||||
shf_enable <= '1';
|
||||
|
||||
|
||||
end generate gTIME_REF1;
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
|
@ -182,28 +176,28 @@ begin -- RTL
|
|||
-- Read the signal transitions recorded in the FIFO, apply the static delay
|
||||
pDELAY_WAVE_GEN : process(clk)
|
||||
begin
|
||||
if(clk = '1' and clk'event) then
|
||||
if(init = '1' or (time_elapsed = '1' and new_event = '0')) then
|
||||
if (clk = '1' and clk'event) then
|
||||
if (init = '1' or (time_elapsed = '1' and new_event = '0')) then
|
||||
pending_trans <= '0';
|
||||
elsif(new_event = '1') then
|
||||
elsif (new_event = '1') then
|
||||
pending_trans <= '1';
|
||||
end if;
|
||||
if(pending_trans = '0' and fifo_empty = '0' and fifo_rd_en = '0' and new_event = '0') then
|
||||
if (pending_trans = '0' and fifo_empty = '0' and fifo_rd_en = '0' and new_event = '0') then
|
||||
fifo_rd_en <= '1';
|
||||
else
|
||||
fifo_rd_en <= '0';
|
||||
end if;
|
||||
end if;
|
||||
end if;
|
||||
end process pDELAY_WAVE_GEN;
|
||||
|
||||
pGEN_OUT : process(rstN, clk)
|
||||
begin
|
||||
if(rstN = '0') then
|
||||
wave_out_i <= '0';
|
||||
elsif(clk = '1' and clk'event) then
|
||||
if(init = '1') then
|
||||
if (rstN = '0') then
|
||||
wave_out_i <= '0';
|
||||
elsif (clk = '1' and clk'event) then
|
||||
if (init = '1') then
|
||||
wave_out_i <= wave_in_d;
|
||||
elsif(toggle_out = '1') then
|
||||
elsif (toggle_out = '1') then
|
||||
wave_out_i <= not wave_out_i;
|
||||
end if;
|
||||
end if;
|
||||
|
|
@ -213,14 +207,14 @@ begin -- RTL
|
|||
-- to achieve small delays (< 8).
|
||||
pDELAY_THROUGH_SHF : process(clk)
|
||||
begin
|
||||
if(clk = '1' and clk'event) then
|
||||
if(shf_enable = '1') then
|
||||
if (clk = '1' and clk'event) then
|
||||
if (shf_enable = '1') then
|
||||
delay_line <= delay_line(6 downto 0) & wave_in;
|
||||
end if;
|
||||
end if;
|
||||
end process pDELAY_THROUGH_SHF;
|
||||
|
||||
toggle_out <= time_elapsed and pending_trans;
|
||||
toggle_out <= time_elapsed and pending_trans;
|
||||
|
||||
-- When using the external counter, the input signal might have multiple rising and
|
||||
-- falling events whitout a change a value in the counter. When this happens,
|
||||
|
|
@ -228,26 +222,26 @@ begin -- RTL
|
|||
-- block. To make the behaviour more predictable, when using the external
|
||||
-- counter, a positive edge detector is inserted at the output.
|
||||
|
||||
gOUT_GEN0: if use_ext_time = false generate
|
||||
gOUT_GEN0 : if use_ext_time = false generate
|
||||
|
||||
wave_out_ii <= wave_out_i when unsigned(delay) >= 8 else delay_line(to_integer(unsigned(delay(2 downto 0))));
|
||||
|
||||
pOUT_GEN0: process(clk)
|
||||
|
||||
pOUT_GEN0 : process(clk)
|
||||
begin
|
||||
if(clk = '1' and clk'event) then
|
||||
if (clk = '1' and clk'event) then
|
||||
wave_out <= wave_out_ii;
|
||||
end if;
|
||||
end process pOUT_GEN0;
|
||||
|
||||
end generate gOUT_GEN0;
|
||||
|
||||
gOUT_GEN1: if use_ext_time = true generate
|
||||
|
||||
pOUT_GEN1: process(clk)
|
||||
gOUT_GEN1 : if use_ext_time = true generate
|
||||
|
||||
pOUT_GEN1 : process(clk)
|
||||
begin
|
||||
if(clk = '1' and clk'event) then
|
||||
if (clk = '1' and clk'event) then
|
||||
wave_out_i_d <= wave_out_i;
|
||||
wave_out <= wave_out_i and not wave_out_i_d;
|
||||
wave_out <= wave_out_i and not wave_out_i_d;
|
||||
end if;
|
||||
end process pOUT_GEN1;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue