1
0
mirror of https://github.com/aolofsson/oh.git synced 2025-01-30 02:32:53 +08:00

Fixing careless mistakes..

This commit is contained in:
Andreas Olofsson 2015-11-06 22:51:09 -05:00
parent 9383f32764
commit 65f772ddef
5 changed files with 84 additions and 84 deletions

View File

@ -153,7 +153,6 @@ module elink (/*AUTOARG*/
*/
defparam erx.ID = ID;
defparam erx.IOSTD_ELINK = IOSTD_ELINK;
defparam erx.ETYPE = ETYPE;
erx erx(.rx_active (elink_active),
@ -205,7 +204,6 @@ module elink (/*AUTOARG*/
*/
defparam etx.ID = ID;
defparam etx.IOSTD_ELINK = IOSTD_ELINK;
defparam etx.ETYPE = ETYPE;
etx etx(.etx_nreset (etx_nreset),

View File

@ -106,33 +106,32 @@ module erx (/*AUTOARG*/
/***********************************************************/
/*RECEIVER I/O LOGIC */
/***********************************************************/
defparam erx_io.IOSTD_ELINK=IOSTD_ELINK;
defparam erx_io.ETYPE=ETYPE;
erx_io erx_io (
erx_io #(.ETYPE(ETYPE))
erx_io (
/*AUTOINST*/
// Outputs
.rx_clkin (rx_clkin),
.rxo_wr_wait_p (rxo_wr_wait_p),
.rxo_wr_wait_n (rxo_wr_wait_n),
.rxo_rd_wait_p (rxo_rd_wait_p),
.rxo_rd_wait_n (rxo_rd_wait_n),
.rx_access (rx_access),
.rx_burst (rx_burst),
.rx_packet (rx_packet[PW-1:0]),
// Inputs
.erx_io_nreset (erx_io_nreset),
.rx_lclk (rx_lclk),
.rx_lclk_div4 (rx_lclk_div4),
.idelay_value (idelay_value[44:0]),
.load_taps (load_taps),
.rxi_lclk_p (rxi_lclk_p),
.rxi_lclk_n (rxi_lclk_n),
.rxi_frame_p (rxi_frame_p),
.rxi_frame_n (rxi_frame_n),
.rxi_data_p (rxi_data_p[7:0]),
.rxi_data_n (rxi_data_n[7:0]),
.rx_wr_wait (rx_wr_wait),
.rx_rd_wait (rx_rd_wait));
// Outputs
.rx_clkin (rx_clkin),
.rxo_wr_wait_p (rxo_wr_wait_p),
.rxo_wr_wait_n (rxo_wr_wait_n),
.rxo_rd_wait_p (rxo_rd_wait_p),
.rxo_rd_wait_n (rxo_rd_wait_n),
.rx_access (rx_access),
.rx_burst (rx_burst),
.rx_packet (rx_packet[PW-1:0]),
// Inputs
.erx_io_nreset (erx_io_nreset),
.rx_lclk (rx_lclk),
.rx_lclk_div4 (rx_lclk_div4),
.idelay_value (idelay_value[44:0]),
.load_taps (load_taps),
.rxi_lclk_p (rxi_lclk_p),
.rxi_lclk_n (rxi_lclk_n),
.rxi_frame_p (rxi_frame_p),
.rxi_frame_n (rxi_frame_n),
.rxi_data_p (rxi_data_p[7:0]),
.rxi_data_n (rxi_data_n[7:0]),
.rx_wr_wait (rx_wr_wait),
.rx_rd_wait (rx_rd_wait));
/**************************************************************/
/*ELINK CORE LOGIC */

View File

@ -103,28 +103,28 @@ module erx_clocks (/*AUTOARG*/
always @ (posedge sys_clk or negedge rx_nreset_in)
if(!rx_nreset_in)
reset_state[2:0] <= `RESET_ALL;
reset_state[2:0] <= `RX_RESET_ALL;
else if(heartbeat)
case(reset_state[2:0])
`RESET_ALL :
`RX_RESET_ALL :
if(~soft_reset)
reset_state[2:0] <= `START_PLL;
`START_PLL :
reset_state[2:0] <= `RX_START_PLL;
`RX_START_PLL :
if(pll_locked_sync & idelay_ready)
reset_state[2:0] <= `ACTIVE;
`ACTIVE:
reset_state[2:0] <= `RX_ACTIVE;
`RX_ACTIVE:
if(soft_reset)
reset_state[2:0] <= `RESET_ALL; //stay there until next reset
reset_state[2:0] <= `RX_RESET_ALL; //stay there until next reset
endcase // case (reset_state[2:0])
assign pll_reset = (reset_state[2:0]==`RESET_ALL);
assign idelay_reset = (reset_state[2:0]==`RESET_ALL);
assign pll_reset = (reset_state[2:0]==`RX_RESET_ALL);
assign idelay_reset = (reset_state[2:0]==`RX_RESET_ALL);
//asynch rx block reset
assign rx_nreset = ~(reset_state[2:0] != `ACTIVE);
assign rx_nreset = ~(reset_state[2:0] != `RX_ACTIVE);
//active indicator
assign rx_active = (reset_state[2:0] == `ACTIVE);
assign rx_active = (reset_state[2:0] == `RX_ACTIVE);
//#############################
//#RESET SYNCING
@ -133,13 +133,15 @@ module erx_clocks (/*AUTOARG*/
.nrst_out (erx_io_nreset),
// Inputs
.clk (rx_lclk),
.nrst_in (rx_nreset));
.nrst_in (rx_nreset)
);
rsync rsync_core (// Outputs
.nrst_out (erx_nreset),
// Inputs
.clk (rx_lclk_div4),
.nrst_in (rx_nreset));
.nrst_in (rx_nreset)
);
`ifdef TARGET_XILINX

View File

@ -182,29 +182,30 @@ module etx(/*AUTOARG*/
/*TRANSMIT I/O LOGIC */
/***********************************************************/
etx_io etx_io (.nreset (etx_io_nreset),
etx_io #(.ETYPE(ETYPE))
etx_io (.nreset (etx_io_nreset),
/*AUTOINST*/
// Outputs
.txo_lclk_p (txo_lclk_p),
.txo_lclk_n (txo_lclk_n),
.txo_frame_p (txo_frame_p),
.txo_frame_n (txo_frame_n),
.txo_data_p (txo_data_p[7:0]),
.txo_data_n (txo_data_n[7:0]),
.tx_io_wait (tx_io_wait),
.tx_wr_wait (tx_wr_wait),
.tx_rd_wait (tx_rd_wait),
// Inputs
.tx_lclk (tx_lclk),
.tx_lclk_io (tx_lclk_io),
.tx_lclk90 (tx_lclk90),
.txi_wr_wait_p (txi_wr_wait_p),
.txi_wr_wait_n (txi_wr_wait_n),
.txi_rd_wait_p (txi_rd_wait_p),
.txi_rd_wait_n (txi_rd_wait_n),
.tx_packet (tx_packet[PW-1:0]),
.tx_access (tx_access),
.tx_burst (tx_burst));
// Outputs
.txo_lclk_p (txo_lclk_p),
.txo_lclk_n (txo_lclk_n),
.txo_frame_p (txo_frame_p),
.txo_frame_n (txo_frame_n),
.txo_data_p (txo_data_p[7:0]),
.txo_data_n (txo_data_n[7:0]),
.tx_io_wait (tx_io_wait),
.tx_wr_wait (tx_wr_wait),
.tx_rd_wait (tx_rd_wait),
// Inputs
.tx_lclk (tx_lclk),
.tx_lclk_io (tx_lclk_io),
.tx_lclk90 (tx_lclk90),
.txi_wr_wait_p (txi_wr_wait_p),
.txi_wr_wait_n (txi_wr_wait_n),
.txi_rd_wait_p (txi_rd_wait_p),
.txi_rd_wait_n (txi_rd_wait_n),
.tx_packet (tx_packet[PW-1:0]),
.tx_access (tx_access),
.tx_burst (tx_burst));
endmodule // elink

View File

@ -110,44 +110,44 @@ module etx_clocks (/*AUTOARG*/
//Reset sequence state machine
always @ (posedge sys_clk or negedge sys_nreset)
if(!sys_nreset)
reset_state[2:0] <= `RESET_ALL;
reset_state[2:0] <= `TX_RESET_ALL;
else if(heartbeat)
case(reset_state[2:0])
`RESET_ALL :
`TX_RESET_ALL :
if(~soft_reset)
reset_state[2:0] <= `START_CCLK;
`START_CCLK :
reset_state[2:0] <= `TX_START_CCLK;
`TX_START_CCLK :
if(mmcm_locked_sync)
reset_state[2:0] <= `STOP_CCLK;
`STOP_CCLK :
reset_state[2:0] <= `DEASSERT_RESET;
`DEASSERT_RESET :
reset_state[2:0] <= `HOLD_IT;
`HOLD_IT :
reset_state[2:0] <= `TX_STOP_CCLK;
`TX_STOP_CCLK :
reset_state[2:0] <= `TX_DEASSERT_RESET;
`TX_DEASSERT_RESET :
reset_state[2:0] <= `TX_HOLD_IT;
`TX_HOLD_IT :
if(mmcm_locked_sync)
reset_state[2:0] <= `ACTIVE;
`ACTIVE:
reset_state[2:0] <= `TX_ACTIVE;
`TX_ACTIVE:
if(soft_reset)
reset_state[2:0] <= `RESET_ALL; //stay there until nex reset
reset_state[2:0] <= `TX_RESET_ALL; //stay there until nex reset
endcase // case (reset_state[2:0])
//reset mmcm (async)
assign mmcm_reset = (reset_state[2:0]==`RESET_ALL) |
(reset_state[2:0]==`STOP_CCLK) |
(reset_state[2:0]==`DEASSERT_RESET)
assign mmcm_reset = (reset_state[2:0]==`TX_RESET_ALL) |
(reset_state[2:0]==`TX_STOP_CCLK) |
(reset_state[2:0]==`TX_DEASSERT_RESET)
;
//reset chip (active low)
assign chip_nreset = (reset_state[2:0]==`DEASSERT_RESET) |
(reset_state[2:0]==`HOLD_IT) |
(reset_state[2:0]==`ACTIVE);
assign chip_nreset = (reset_state[2:0]==`TX_DEASSERT_RESET) |
(reset_state[2:0]==`TX_HOLD_IT) |
(reset_state[2:0]==`TX_ACTIVE);
//reset the elink
assign tx_nreset = ~(reset_state[2:0] != `ACTIVE);
assign tx_nreset = ~(reset_state[2:0] != `TX_ACTIVE);
assign tx_active = (reset_state[2:0] == `ACTIVE);
assign tx_active = (reset_state[2:0] == `TX_ACTIVE);
//#############################
//#RESET SYNCING