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

Release Candidate v5.1.0 #408

Merged
merged 9 commits into from
Jul 1, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
implementing the new mpsTripValue feature
ruck314 committed Sep 28, 2023
commit 33798125e2ab6254a65d9f20ae1c2c3e06427c8c
35 changes: 24 additions & 11 deletions AppMps/rtl/AppMpsEncoder.vhd
Original file line number Diff line number Diff line change
@@ -58,13 +58,15 @@ architecture mapping of AppMpsEncoder is
constant APP_CONFIG_C : MpsAppConfigType := getMpsAppConfig(APP_TYPE_G);

type RegType is record
tholdMem : Slv4VectorArray(MPS_CHAN_COUNT_C-1 downto 0, 7 downto 0);
mpsMessage : MpsMessageType;
mpsTripValue : Slv32Array(MPS_CHAN_COUNT_C-1 downto 0);
tholdMem : Slv4VectorArray(MPS_CHAN_COUNT_C-1 downto 0, 7 downto 0);
mpsMessage : MpsMessageType;
end record;

constant REG_INIT_C : RegType := (
tholdMem => (others => (others => (others => '0'))),
mpsMessage => mpsMessageInit(APP_CONFIG_C.BYTE_COUNT_C));
mpsTripValue => (others => (others => '0')),
tholdMem => (others => (others => (others => '0'))),
mpsMessage => mpsMessageInit(APP_CONFIG_C.BYTE_COUNT_C));

signal r : RegType := REG_INIT_C;
signal rin : RegType;
@@ -78,6 +80,7 @@ architecture mapping of AppMpsEncoder is
valid : in sl;
holdDisable : in sl;
bitPos : in integer;
tripValue : inout slv;
tholdMemOut : inout slv;
message : inout Slv8Array) is

@@ -101,6 +104,8 @@ architecture mapping of AppMpsEncoder is

message(config.BYTE_MAP_C)(bitPos) := '1';

tripValue := value;

end if;
end procedure;

@@ -124,8 +129,9 @@ architecture mapping of AppMpsEncoder is
end if;
end procedure;

signal mpsReg : MpsAppRegType;
signal mpsMsgDrop : sl;
signal mpsReg : MpsAppRegType;
signal mpsMsgDrop : sl;
signal rstTripValue : sl;

-- attribute MARK_DEBUG : string;
-- attribute MARK_DEBUG of r : signal is "TRUE";
@@ -155,6 +161,8 @@ begin
axilWriteSlave => axilWriteSlave,
mpsMessage => r.mpsMessage,
mpsMsgDrop => mpsMsgDrop,
mpsTripValue => r.mpsTripValue,
rstTripValue => rstTripValue,
mpsAppRegisters => mpsReg);

---------------------------------
@@ -177,7 +185,7 @@ begin
---------------------------------
-- Thresholds
---------------------------------
comb : process (axilRst, mpsReg, mpsSelect, r) is
comb : process (axilRst, mpsReg, mpsSelect, r, rstTripValue) is
variable v : RegType;
variable chan : integer;
variable thold : integer;
@@ -245,14 +253,14 @@ begin
compareTholds (mpsReg.mpsChanReg(chan).lcls1Thold,
APP_CONFIG_C.CHAN_CONFIG_C(chan),
mpsSelect.chanData(chan), mpsSelect.mpsIgnore(chan), mpsSelect.valid, '1',
0, v.tholdMem(chan, 0), msgData);
0, v.mpsTripValue(chan), v.tholdMem(chan, 0), msgData);

-- LCLS2 idle table
elsif APP_CONFIG_C.CHAN_CONFIG_C(chan).IDLE_EN_C and mpsReg.mpsChanReg(chan).idleEn = '1' and mpsSelect.selectIdle = '1' then
compareTholds (mpsReg.mpsChanReg(chan).idleThold,
APP_CONFIG_C.CHAN_CONFIG_C(chan),
mpsSelect.chanData(chan), mpsSelect.mpsIgnore(chan), mpsSelect.valid, '0',
7, v.tholdMem(chan, 7), msgData);
7, v.mpsTripValue(chan), v.tholdMem(chan, 7), msgData);

-- Multiple thresholds
else
@@ -263,14 +271,14 @@ begin
compareTholds (mpsReg.mpsChanReg(chan).altTholds(thold),
APP_CONFIG_C.CHAN_CONFIG_C(chan),
mpsSelect.chanData(chan), mpsSelect.mpsIgnore(chan), mpsSelect.valid, '0',
thold, v.tholdMem(chan, thold), msgData);
thold, v.mpsTripValue(chan), v.tholdMem(chan, thold), msgData);

-- Standard table
else
compareTholds (mpsReg.mpsChanReg(chan).stdTholds(thold),
APP_CONFIG_C.CHAN_CONFIG_C(chan),
mpsSelect.chanData(chan), mpsSelect.mpsIgnore(chan), mpsSelect.valid, '0',
thold, v.tholdMem(chan, thold), msgData);
thold, v.mpsTripValue(chan), v.tholdMem(chan, thold), msgData);
end if;
end loop;
end if;
@@ -281,6 +289,11 @@ begin
-- Update message data
v.mpsMessage.message(APP_CONFIG_C.BYTE_COUNT_C-1 downto 0) := msgData;

-- Check for trip value reset
if (rstTripValue = '1') then
v.mpsTripValue := (others => (others => '0'));
end if;

-- Synchronous Reset
if (axilRst = '1') then
v := REG_INIT_C;
4 changes: 4 additions & 0 deletions AppMps/rtl/AppMpsReg.vhd
Original file line number Diff line number Diff line change
@@ -45,6 +45,8 @@ entity AppMpsReg is
-- MPS message monitoring
mpsMessage : in MpsMessageType;
mpsMsgDrop : in sl;
mpsTripValue : in Slv32Array(MPS_CHAN_COUNT_C-1 downto 0);
rstTripValue : out sl;
-- MPS Configuration Registers
mpsAppRegisters : out MpsAppRegType);
end AppMpsReg;
@@ -103,6 +105,7 @@ begin
-- MPS message monitoring
mpsMessage => mpsMessage,
mpsMsgDrop => mpsMsgDrop,
rstTripValue => rstTripValue,
-- MPS Configuration Registers
mpsCore => mpsAppRegisters.mpsCore,
beamDestMask => mpsAppRegisters.beamDestMask,
@@ -143,6 +146,7 @@ begin
port map (
-- MPS Configuration Registers
mpsChanReg => mpsAppRegisters.mpsChanReg(i),
mpsTripValue => mpsTripValue(i),
-- AXI-Lite Interface
axilClk => axilClk,
axilRst => axilRst,