Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a forceTrigger signal to TrigControlAxi #45

Merged
merged 5 commits into from
Nov 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 49 additions & 28 deletions shared/rtl/TrigControlAxi.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ entity TrigControlAxi is

-- Pause signal monitor
runTrigPause : in sl := '0';
daqTrigPause : in sl := '0'
daqTrigPause : in sl := '0';

forceTrigger : in sl := '0'
);

end TrigControlAxi;
Expand Down Expand Up @@ -142,32 +144,34 @@ architecture rtl of TrigControlAxi is
signal combinedRunTrig : sl;
signal combinedDaqTrig : sl;

signal runTriggerEdge : std_logic;
signal daqTriggerEdge : std_logic;
signal runTriggerCnt : std_logic_vector(31 downto 0);
signal daqTriggerCnt : std_logic_vector(31 downto 0);
signal runTriggerOut : std_logic;
signal daqTriggerOut : std_logic;
signal countEnable : std_logic;
signal daqCountEnable : std_logic;
signal acqCount : std_logic_vector(31 downto 0);
signal daqCount : std_logic_vector(31 downto 0);
signal runPauseCnt : std_logic_vector(31 downto 0);
signal daqPauseCnt : std_logic_vector(31 downto 0);
signal runPauseCntSync : std_logic_vector(31 downto 0);
signal daqPauseCntSync : std_logic_vector(31 downto 0);
signal acqCountSync : std_logic_vector(31 downto 0);
signal daqCountSync : std_logic_vector(31 downto 0);
signal swRun : std_logic;
signal swRunSync : std_logic;
signal swRead : std_logic;
signal iRunTrigOut : std_logic;
signal iDaqTrigOut : std_logic;
signal hwRunTrig : std_logic;
signal hwDaqTrig : std_logic;
signal autoRunEn : std_logic;
signal autoDaqEn : std_logic;
signal runTriggerEdge : std_logic;
signal daqTriggerEdge : std_logic;
signal runTriggerCnt : std_logic_vector(31 downto 0);
signal daqTriggerCnt : std_logic_vector(31 downto 0);
signal runTriggerOut : std_logic;
signal daqTriggerOut : std_logic;
signal countEnable : std_logic;
signal daqCountEnable : std_logic;
signal acqCount : std_logic_vector(31 downto 0);
signal daqCount : std_logic_vector(31 downto 0);
signal runPauseCnt : std_logic_vector(31 downto 0);
signal daqPauseCnt : std_logic_vector(31 downto 0);
signal runPauseCntSync : std_logic_vector(31 downto 0);
signal daqPauseCntSync : std_logic_vector(31 downto 0);
signal acqCountSync : std_logic_vector(31 downto 0);
signal daqCountSync : std_logic_vector(31 downto 0);
signal swRun : std_logic;
signal swRunSync : std_logic;
signal forceTrigSync : std_logic;
signal swRead : std_logic;
signal iRunTrigOut : std_logic;
signal iDaqTrigOut : std_logic;
signal hwRunTrig : std_logic;
signal hwDaqTrig : std_logic;
signal autoRunEn : std_logic;
signal autoDaqEn : std_logic;

signal forceRead : std_logic;


-- Op code signals
Expand Down Expand Up @@ -203,6 +207,21 @@ begin
locRst => sysRst
);

U_forceTriggerSync : entity surf.Synchronizer
generic map(
TPD_G => TPD_G,
RST_POLARITY_G => '1',
OUT_POLARITY_G => '1',
RST_ASYNC_G => false,
STAGES_G => 2,
BYPASS_SYNC_G => false,
INIT_G => "0")
port map(
clk => appClk,
rst => appRst,
dataIn => forceTrigger,
dataOut => forceTrigSync
);

U_TrigPulserSync : entity surf.Synchronizer
generic map(
Expand All @@ -224,8 +243,10 @@ begin
if rising_edge(appClk) then
if appRst = '1' then
swRead <= '0' after TPD_G;
forceRead <= '0' after TPD_G;
else
swRead <= swRunSync after TPD_G;
forceRead <= forceTrigSync after TPD_G;
end if;
end if;
end process;
Expand Down Expand Up @@ -413,8 +434,8 @@ begin
--------------------------------
-- Acquisition Counter And Outputs
--------------------------------
acqStart <= iRunTrigOut or swRunSync;
dataSend <= iDaqTrigOut or swRead;
acqStart <= iRunTrigOut or swRunSync or forceTrigSync;
dataSend <= iDaqTrigOut or swRead or forceRead;

process ( appClk, appRst ) begin
if ( appRst = '1' ) then
Expand Down
Loading