Commit 885d5b83 authored by egousiou's avatar egousiou

jtag 1st trial

git-svn-id: http://svn.ohwr.org/cern-fip/trunk/hdl/design@226 7f0067c9-7624-46c7-bd39-3fb5400c0213
parent 7cc216bb
......@@ -232,6 +232,12 @@ entity nanofip is
we_i : in std_logic; -- WISHBONE write enable
-- User Interface, JTAG Controller
jc_tdo_i : in std_logic;
-- OUTPUTS
-- WorldFIP settings
......@@ -266,10 +272,16 @@ entity nanofip is
-- User Interface, WISHBONE Slave
dat_o : out std_logic_vector(15 downto 0);-- dat_o(7 downto 0) : WISHBONE data out, memory mode
-- dat_o(15 downto 0): data out, stand-alone mode
dat_o : out std_logic_vector (15 downto 0);-- dat_o(7 downto 0) : WISHBONE data out, memory mode
-- dat_o(15 downto 0): data out, stand-alone mode
ack_o : out std_logic -- WISHBONE acknowledge
ack_o : out std_logic; -- WISHBONE acknowledge
-- User Interface, JTAG Controller
jc_tms_o : out std_logic;
jc_tdi_o : out std_logic;
jc_tck_o : out std_logic
);
......@@ -296,6 +308,8 @@ architecture struc of nanofip is
-- WF_consumption outputs
signal s_var1_rdy, s_var2_rdy, s_var3_rdy : std_logic;
signal s_assert_RSTON_p, s_reset_nFIP_and_FD_p, s_nfip_status_r_tler : std_logic;
signal s_jc_start_p : std_logic;
signal s_jc_mem_data : std_logic_vector (7 downto 0);
-- WF_fd_receiver outputs
signal s_rx_fss_received_p, s_rx_fss_crc_fes_ok_p, s_rx_crc_wrong_p : std_logic;
signal s_rx_byte_ready_p : std_logic;
......@@ -313,6 +327,9 @@ architecture struc of nanofip is
signal s_model_id_dec, s_constr_id_dec : std_logic_vector (7 downto 0);
-- WF_wb_controller outputs
signal s_wb_ack_prod : std_logic;
-- WF_model_constr_dec outputs
signal s_jc_mem_adr_rd : std_logic_vector (8 downto 0);
signal jc_tdo_byte_o : std_logic_vector (7 downto 0);
--=================================================================================================
......@@ -363,13 +380,16 @@ begin
cons_bytes_excess_i => s_cons_bytes_excess,
var_i => s_var,
byte_index_i => s_prod_cons_byte_index,
jc_mem_adr_rd_i => s_jc_mem_adr_rd,
-------------------------------------------------------------
var1_rdy_o => s_var1_rdy,
var2_rdy_o => s_var2_rdy,
jc_start_p_o => s_jc_start_p,
data_o => dat_o,
nfip_status_r_tler_p_o => s_nfip_status_r_tler,
assert_rston_p_o => s_assert_RSTON_p,
rst_nfip_and_fd_p_o => s_reset_nFIP_and_FD_p);
rst_nfip_and_fd_p_o => s_reset_nFIP_and_FD_p,
jc_mem_data_o => s_jc_mem_data);
-------------------------------------------------------------
......@@ -437,7 +457,7 @@ begin
---------------------------------------------------------------------------------------------------
-- WF_fd_Transmitter --
-- WF_fd_Transmitter --
---------------------------------------------------------------------------------------------------
FIELDRIVE_Transmitter: WF_fd_transmitter
......@@ -459,6 +479,27 @@ begin
---------------------------------------------------------------------------------------------------
-- WF_JTAG_player --
---------------------------------------------------------------------------------------------------
JTAG_player: WF_jtag_player
port map (
uclk_i => uclk_i,
nfip_rst_i => s_nfip_intern_rst,
jc_mem_data_i => s_jc_mem_data,
jc_start_p_i => s_jc_start_p,
jc_tdo_i => jc_tdo_i,
-----------------------------------------------------------------
jc_tms_o => jc_tms_o,
jc_tdi_o => jc_tdi_o,
jc_tck_o => jc_tck_o,
jc_tdo_byte_o => jc_tdo_byte_o,
jc_mem_adr_rd_o => s_jc_mem_adr_rd);
-----------------------------------------------------------------
---------------------------------------------------------------------------------------------------
-- WF_engine_control --
---------------------------------------------------------------------------------------------------
......
This diff is collapsed.
......@@ -131,6 +131,9 @@ entity WF_cons_outcome is
var1_rdy_o : out std_logic; -- signals new data is received and can safely be read
var2_rdy_o : out std_logic; -- signals new data is received and can safely be read
-- Signal to the WF_JTAG_player unit
jc_start_p_o : out std_logic;
-- Signal to the WF_status_bytes_gen unit
nfip_status_r_tler_p_o : out std_logic; -- received PDU_TYPE or Length error
-- nanoFIP status byte bit 4
......@@ -185,9 +188,9 @@ begin
if nfip_rst_i = '1' then
s_cons_frame_ok_p <= '0';
nfip_status_r_tler_p_o <= '0';
else
else -- only consumed RP_DATs
if (var_i = var_1) or (var_i = var_2) or (var_i = var_rst) then -- only consumed RP_DATs
if (var_i = var_1) or (var_i = var_2) or (var_i = var_rst) or (var_i = var_jc1) then
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
if (rx_fss_crc_fes_ok_p_i = '1') and -- FSS CRC FES check
......@@ -211,18 +214,18 @@ begin
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
if (cons_bytes_excess_i = '1') or -- excess of bytes(without FES detection)
(((rx_fss_crc_fes_ok_p_i = '1') or (rx_crc_wrong_p_i = '1')) and -- upon FES detection
(((rx_fss_crc_fes_ok_p_i = '1') or (rx_crc_wrong_p_i = '1')) and -- upon FES detection
((not ((cons_ctrl_byte_i(5 downto 0) = c_RP_DAT_CTRL_BYTE) or -- CTRL byte check
((not ((cons_ctrl_byte_i(5 downto 0) = c_RP_DAT_CTRL_BYTE) or -- CTRL byte check
(cons_ctrl_byte_i(5 downto 0) = c_RP_DAT_MSG_CTRL_BYTE) or
(cons_ctrl_byte_i(5 downto 0) = c_RP_DAT_RQ1_CTRL_BYTE) or
(cons_ctrl_byte_i(5 downto 0) = c_RP_DAT_RQ2_CTRL_BYTE) or
(cons_ctrl_byte_i(5 downto 0) = c_RP_DAT_RQ1_MSG_CTRL_BYTE)or
(cons_ctrl_byte_i(5 downto 0) = c_RP_DAT_RQ2_MSG_CTRL_BYTE)))or
(cons_pdu_byte_i /= c_PDU_TYPE_BYTE) or -- PDU_TYPE byte check
(cons_pdu_byte_i /= c_PDU_TYPE_BYTE) or -- PDU_TYPE byte check
(unsigned(byte_index_i ) /= (unsigned(cons_lgth_byte_i) + 5)))) then -- LGTH byte check
(unsigned(byte_index_i ) /= (unsigned(cons_lgth_byte_i) + 5)))) then -- LGTH byte check
nfip_status_r_tler_p_o <= '1';
else
......@@ -313,6 +316,16 @@ begin
end if;
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- JTAG_player -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
if (var_i = var_jc1) and (s_cons_frame_ok_p = '1') then
jc_start_p_o <= '1';
else
jc_start_p_o <= '0';
end if;
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
end if;
end if;
end process;
......
......@@ -142,7 +142,7 @@ entity WF_consumption is
-- nanoFIP User Interface, WISHBONE Slave
wb_clk_i : in std_logic;
wb_adr_i : in std_logic_vector(8 downto 0);
wb_adr_i : in std_logic_vector (8 downto 0);
-- used by: WF_cons_bytes_processor for the managment of the Consumption RAM
......@@ -160,6 +160,11 @@ entity WF_consumption is
-- used by: WF_cons_outcome for the validation of the Length byte
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- Signal from the WF_jtag_player unit
jc_mem_adr_rd_i : in std_logic_vector (8 downto 0);
-----------------------------------------------------------------------------------------------
-- OUTPUTS
......@@ -167,6 +172,9 @@ entity WF_consumption is
var1_rdy_o : out std_logic;
var2_rdy_o : out std_logic;
-- Signals to the WF_JTAG_player
jc_start_p_o : out std_logic;
-- nanoFIP User Interface, WISHBONE Slave outputs
data_o : out std_logic_vector (15 downto 0);
......@@ -175,7 +183,10 @@ entity WF_consumption is
-- Signals to the WF_reset_unit
assert_rston_p_o : out std_logic;
rst_nfip_and_fd_p_o : out std_logic
rst_nfip_and_fd_p_o : out std_logic;
-- Signals to the WF_jtag_player unit
jc_mem_data_o : out std_logic_vector (7 downto 0)
);
end entity WF_consumption;
......@@ -211,8 +222,10 @@ begin
byte_i => rx_byte_i,
wb_clk_i => wb_clk_i,
wb_adr_i => wb_adr_i,
jc_mem_adr_rd_i => jc_mem_adr_rd_i,
--------------------------------------------------------
data_o => data_o,
jc_mem_data_o => jc_mem_data_o,
cons_ctrl_byte_o => s_cons_ctrl_byte,
cons_pdu_byte_o => s_cons_pdu_byte,
cons_lgth_byte_o => s_cons_lgth_byte,
......@@ -245,6 +258,7 @@ begin
--------------------------------------------------------
var1_rdy_o => var1_rdy_o,
var2_rdy_o => var2_rdy_o,
jc_start_p_o => jc_start_p_o,
nfip_status_r_tler_p_o => nfip_status_r_tler_p_o,
assert_rston_p_o => assert_rston_p_o,
rst_nfip_and_fd_p_o => rst_nfip_and_fd_p_o);
......
......@@ -133,7 +133,7 @@ entity WF_engine_control is
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- Signals from the WF_fd_receiver unit
rx_byte_i : in std_logic_vector(7 downto 0); -- deserialized ID_DAT/ RP_DAT byte
rx_byte_i : in std_logic_vector (7 downto 0); -- deserialized ID_DAT/ RP_DAT byte
rx_byte_ready_p_i : in std_logic; -- indication of a new byte on rx_byte_i
rx_fss_crc_fes_ok_p_i : in std_logic; -- indication of a frame (ID_DAT or RP_DAT) with
......@@ -237,11 +237,11 @@ begin
-- o if the variable byte corresponds to a defined variable,
-- o if the subscriber byte matches the station's address, or if the variable is a broadcast
-- o and if the frame finishes with a correct CRC and FES.
-- If the received variable is a produced (var_presence, var_identif, var_3) the FSM stays
-- If the received variable is a produced (var_presence, var_identif, var_3, var_jc3) the FSM stays
-- in the "produce_wait_turnar_time" state until the expiration of the turnaround time and then
-- jumps to the "produce" state, waiting for the WF_fd_serializer to finish the transmission;
-- then it goes back to idle.
-- If the received variable is a consumed (var_1, var_2, var_rst) the FSM stays in the
-- If the received variable is a consumed (var_1, var_2, var_rst, var_jc1) the FSM stays in the
-- "consume_wait_FSS" state until the arrival of a FSS or the expiration of the silence time.
-- After the arrival of a FSS the FSM jumps to the "consume" state, where it stays until the
-- WF_fd_receiver receives a FES.
......@@ -862,6 +862,18 @@ begin
s_prod_or_cons <= c_VARS_ARRAY(c_VAR_RST_INDEX).prod_or_cons;
s_broadcast_var <= c_VARS_ARRAY(c_VAR_RST_INDEX).broadcast;
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
elsif rx_byte_i = c_VARS_ARRAY(c_VAR_JC1_INDEX).hexvalue then
s_var_aux <= var_jc1;
s_prod_or_cons <= c_VARS_ARRAY(c_VAR_JC1_INDEX).prod_or_cons;
s_broadcast_var <= c_VARS_ARRAY(c_VAR_JC1_INDEX).broadcast;
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
elsif rx_byte_i = c_VARS_ARRAY(c_VAR_JC3_INDEX).hexvalue then
s_var_aux <= var_jc3;
s_prod_or_cons <= c_VARS_ARRAY(c_VAR_JC3_INDEX).prod_or_cons;
s_broadcast_var <= c_VARS_ARRAY(c_VAR_JC3_INDEX).broadcast;
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
else
s_var_aux <= var_whatever;
......@@ -889,7 +901,9 @@ begin
rx_byte_i = c_VARS_ARRAY(c_VAR_RST_INDEX).hexvalue or
rx_byte_i = c_VARS_ARRAY(c_VAR_1_INDEX).hexvalue or
rx_byte_i = c_VARS_ARRAY(c_VAR_2_INDEX).hexvalue or
rx_byte_i = c_VARS_ARRAY(c_VAR_3_INDEX).hexvalue
rx_byte_i = c_VARS_ARRAY(c_VAR_3_INDEX).hexvalue or
rx_byte_i = c_VARS_ARRAY(c_VAR_JC1_INDEX).hexvalue or
rx_byte_i = c_VARS_ARRAY(c_VAR_JC3_INDEX).hexvalue
else '0';
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment