Skip to content

Commit

Permalink
Setting default control settings on dcard when OUTENC_CONN is disabled
Browse files Browse the repository at this point in the history
Setting default control settings on dcard when OUTENC_CONN is disabled
  • Loading branch information
tomtrafford authored Oct 7, 2024
2 parents 7d202f8 + e4b5f85 commit a2b0249
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
16 changes: 10 additions & 6 deletions src/hdl/dcard_ctrl.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ port (
dcard_ctrl3_io : inout std_logic_vector(15 downto 0);
dcard_ctrl4_io : inout std_logic_vector(15 downto 0);
-- Front Panel Shift Register Interface
INENC_PROTOCOL : in std3_array(3 downto 0);
OUTENC_PROTOCOL : in std3_array(3 downto 0);
OUTENC_CONN_i : in std_logic_vector(3 downto 0);
INENC_PROTOCOL_i : in std3_array(3 downto 0);
OUTENC_PROTOCOL_i : in std3_array(3 downto 0);
DCARD_MODE_o : out std4_array(3 downto 0)
);
end dcard_ctrl;
Expand Down Expand Up @@ -115,10 +116,12 @@ DCARD_MODE(3) <= dcard_ctrl4_io(15 downto 12);

-- Assign CTRL values for Encoder ICs on the Daughter Card
ENC_CTRL_GEN : FOR I IN 0 TO 3 GENERATE
inenc_ctrl(I) <= INENC_CONV(INENC_PROTOCOL(I));
outenc_ctrl(I) <= OUTENC_CONV(INENC_PROTOCOL(I))
when DCARD_MODE(I)(3 downto 1) = DCARD_MONITOR
else OUTENC_CONV(OUTENC_PROTOCOL(I));
inenc_ctrl(I) <= INENC_CONV(INENC_PROTOCOL_i(I));
outenc_ctrl(I) <= OUTENC_CONV(std3_t'("111"))
when OUTENC_CONN_i(I) = '0'
else OUTENC_CONV(INENC_PROTOCOL_i(I))
when DCARD_MODE(I)(3 downto 1) = DCARD_MONITOR
else OUTENC_CONV(OUTENC_PROTOCOL_i(I));
END GENERATE;

-- Interleave Input and Output Controls to the Daughter Card Pins.
Expand All @@ -128,3 +131,4 @@ dcard_ctrl3_io(11 downto 0) <= CONV_PADS(inenc_ctrl(2), outenc_ctrl(2), DCARD_MO
dcard_ctrl4_io(11 downto 0) <= CONV_PADS(inenc_ctrl(3), outenc_ctrl(3), DCARD_MODE(3));

end rtl;

6 changes: 4 additions & 2 deletions src/hdl/slow_top.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,9 @@ port map (
dcard_ctrl3_io => dcard_ctrl3_io,
dcard_ctrl4_io => dcard_ctrl4_io,
-- Front Panel Shift Register Interface
INENC_PROTOCOL => INENC_PROTOCOL,
OUTENC_PROTOCOL => OUTENC_PROTOCOL,
OUTENC_CONN_i => OUTENC_CONN,
INENC_PROTOCOL_i => INENC_PROTOCOL,
OUTENC_PROTOCOL_i => OUTENC_PROTOCOL,
DCARD_MODE_o => DCARD_MODE
);

Expand Down Expand Up @@ -207,3 +208,4 @@ port map (
);

end rtl;

0 comments on commit a2b0249

Please sign in to comment.