working FIFO and TPSRAM without packet flter

This commit is contained in:
2026-04-15 23:54:00 +05:30
parent 77c69687d9
commit e4b91625ea
579 changed files with 1295759 additions and 0 deletions

View File

@@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?><Component xmlns="http://actel.com/sweng/afi"><name>CORETSE</name><vendor>Actel</vendor><library>DirectCore</library><version>4.0.124</version><fileSets><fileSet fileSetId="DESIGNER_FILESET"><file fileid="0"><name>Constraints\CoreTSE.sdc</name><userFileType>SDC</userFileType></file><file fileid="1"><name>Constraints\CoreTSE_mdc.sdc</name><userFileType>SDC</userFileType></file></fileSet><fileSet fileSetId="STIMULUS_FILESET"><file fileid="2"><name>rtl\vlog\test\user\tbi\testbench.v</name><fileType>verilogSource</fileType><vendorExtensions><ModuleUnderTest>testbench</ModuleUnderTest><SimulationTime>-all</SimulationTime></vendorExtensions></file><file fileid="3"><name>rtl\vlog\test\user\tbi\CoreTSE_tb.v</name><fileType>verilogSource</fileType></file><file fileid="4"><name>rtl\vlog\test\user\tbi\CoreTSE_AXI4S_tb.v</name><fileType>verilogSource</fileType></file></fileSet><fileSet fileSetId="ANY_SIMULATION_FILESET"><file fileid="5"><name>coreparameters.v</name><fileType>verilogSource</fileType></file><file fileid="6"><name>mti\scripts\wave.do</name><userFileType>DO</userFileType><vendorExtensions><IncludeInRunDo/></vendorExtensions></file></fileSet><fileSet fileSetId="HDL_FILESET"><file fileid="7"><name>rtl\vlog\core_evaluation\CoreTSE.v</name><userFileType>Verilog</userFileType></file><file fileid="8"><name>rtl\vlog\core_evaluation\include.v</name><fileType>verilogSource</fileType><vendorExtensions><isIncludeFile/></vendorExtensions></file></fileSet></fileSets><hwModel><views><view><fileSetRef>DESIGNER_FILESET</fileSetRef><name>DESIGNER</name></view><view><fileSetRef>STIMULUS_FILESET</fileSetRef><fileSetRef>ANY_SIMULATION_FILESET</fileSetRef><name>SIMULATION</name></view><view><fileSetRef>HDL_FILESET</fileSetRef><name>HDL</name></view></views></hwModel></Component>

View File

@@ -0,0 +1,27 @@
set GMII 0
if {$GMII == 1} {
create_clock -name PCLK -period 12.5 [get_ports {PCLK}]
create_clock -name MTXCLK -period 12.5 [get_ports {MTXCLK}]
create_clock -name MRXCLK -period 12.5 [get_ports {MRXCLK}]
create_clock -name TXCLK -period 8 [get_ports {TXCLK}]
create_clock -name RXCLK -period 8 [get_ports {RXCLK}]
set_clock_groups -asynchronous -group {TXCLK } \
-group {RXCLK } \
-group {PCLK} \
-group {MTXCLK MRXCLK}
} else {
create_clock -name PCLK -period 12.5 [get_ports {PCLK}]
create_clock -name MTXCLK -period 12.5 [get_ports {MTXCLK}]
create_clock -name MRXCLK -period 12.5 [get_ports {MRXCLK}]
create_clock -name TXCLK -period 8 [get_ports {TXCLK}]
create_clock -name RXCLK -period 8 [get_ports {RXCLK}]
create_clock -name TBI_TX_CLK -period 8 [get_ports {TBI_TX_CLK}]
create_clock -name TBI_RX_CLK -period 8 [get_ports {TBI_RX_CLK}]
set_clock_groups -asynchronous -group {TXCLK TBI_TX_CLK} \
-group {RXCLK TBI_RX_CLK} \
-group {PCLK MGMT_CLK} \
-group {MTXCLK MRXCLK}
}
set_false_path -through [ get_nets {CORETSE_C0_0/CORETSE_C0_0/PRESETN } ]

View File

@@ -0,0 +1 @@
create_generated_clock -name {MGMT_CLK} -add -master_clock PCLK -divide_by 8 -source [ get_ports { PCLK } ] [ get_pins { CORETSE_C0_0/CORETSE_C0_0/CoreTSE_TOP_INST/tsmac_top_U0/pe_mcxmac_U0/CTSE_PEMGT_1/mdc } ]

View File

@@ -0,0 +1,19 @@
//--------------------------------------------------------------------
// Created by Microsemi SmartDesign Mon Apr 13 21:41:11 2026
// Parameters for CORETSE
//--------------------------------------------------------------------
parameter ECC_ENABLE = 0;
parameter FAMILY = 26;
parameter GMII_TBI = 1;
parameter HDL_license = "E";
parameter HOST_INTERFACE = 0;
parameter MDIO_PHYID = 18;
parameter PACKET_SIZE = 11;
parameter SAL = 1;
parameter SLIP_ENABLE = 0;
parameter STATS = 1;
parameter testbench = "User";
parameter TXRX_INTR_ENABLE = 1;
parameter WoL = 1;

View File

@@ -0,0 +1,103 @@
onerror {resume}
quietly WaveActivateNextPane {} 0
add wave -noupdate -group Parameters -radix unsigned /testbench/dut_top/FAMILY
add wave -noupdate -group Parameters -radix unsigned /testbench/dut_top/GMII_TBI
add wave -noupdate -group Parameters -radix unsigned /testbench/dut_top/PACKET_SIZE
add wave -noupdate -group Parameters -radix unsigned /testbench/dut_top/SAL
add wave -noupdate -group Parameters -radix unsigned /testbench/dut_top/WoL
add wave -noupdate -group Parameters -radix unsigned /testbench/dut_top/STATS
add wave -noupdate -group Parameters -radix unsigned /testbench/dut_top/MDIO_PHYID
add wave -noupdate -group Parameters -radix unsigned /testbench/dut_top/SLIP_ENABLE
add wave -noupdate -group Parameters -radix unsigned /testbench/dut_top/RXLEN_CNT
add wave -noupdate -expand -group {MAC TX DATA PATH I/F} -radix hexadecimal /testbench/dut_top/MTXCLK
add wave -noupdate -expand -group {MAC TX DATA PATH I/F} -radix hexadecimal /testbench/dut_top/MTXRDY
add wave -noupdate -expand -group {MAC TX DATA PATH I/F} -radix hexadecimal /testbench/dut_top/MTXACPT
add wave -noupdate -expand -group {MAC TX DATA PATH I/F} -radix hexadecimal /testbench/dut_top/MTXSOF
add wave -noupdate -expand -group {MAC TX DATA PATH I/F} -radix hexadecimal /testbench/dut_top/MTXEOF
add wave -noupdate -expand -group {MAC TX DATA PATH I/F} -radix hexadecimal /testbench/dut_top/MTXDAT
add wave -noupdate -expand -group {MAC TX DATA PATH I/F} -radix hexadecimal /testbench/dut_top/MTXBYTEVALID
add wave -noupdate -expand -group {MAC TX DATA PATH I/F} -radix hexadecimal /testbench/dut_top/MTXCFRM
add wave -noupdate -expand -group {MAC TX DATA PATH I/F} -radix hexadecimal /testbench/dut_top/MTXHWM
add wave -noupdate -expand -group {MAC RX DATA PATH I/F} -radix hexadecimal /testbench/dut_top/MRXCLK
add wave -noupdate -expand -group {MAC RX DATA PATH I/F} -radix hexadecimal /testbench/dut_top/MRXRDY
add wave -noupdate -expand -group {MAC RX DATA PATH I/F} -radix hexadecimal /testbench/dut_top/MRXACPT
add wave -noupdate -expand -group {MAC RX DATA PATH I/F} -radix hexadecimal /testbench/dut_top/MRXSOF
add wave -noupdate -expand -group {MAC RX DATA PATH I/F} -radix hexadecimal /testbench/dut_top/MRXEOF
add wave -noupdate -expand -group {MAC RX DATA PATH I/F} -radix hexadecimal /testbench/dut_top/MRXDAT
add wave -noupdate -expand -group {MAC RX DATA PATH I/F} -radix hexadecimal /testbench/dut_top/MRXBYTEVALID
add wave -noupdate -expand -group {MAC RX DATA PATH I/F} -radix hexadecimal /testbench/dut_top/MRXLEN
add wave -noupdate -group {GMII I/F} -radix hexadecimal /testbench/dut_top/GTXCLK
add wave -noupdate -group {GMII I/F} -radix hexadecimal /testbench/dut_top/TXCLK
add wave -noupdate -group {GMII I/F} -radix hexadecimal /testbench/dut_top/RXCLK
add wave -noupdate -group {GMII I/F} -radix hexadecimal /testbench/dut_top/TXEN
add wave -noupdate -group {GMII I/F} -radix hexadecimal /testbench/dut_top/TXD
add wave -noupdate -group {GMII I/F} -radix hexadecimal /testbench/dut_top/TXER
add wave -noupdate -group {GMII I/F} -radix hexadecimal /testbench/dut_top/RXDV
add wave -noupdate -group {GMII I/F} -radix hexadecimal /testbench/dut_top/RXD
add wave -noupdate -group {GMII I/F} -radix hexadecimal /testbench/dut_top/RXER
add wave -noupdate -group {GMII I/F} -radix hexadecimal /testbench/dut_top/CRS
add wave -noupdate -group {GMII I/F} -radix hexadecimal /testbench/dut_top/COL
add wave -noupdate -group {TBI I/F} -radix hexadecimal /testbench/dut_top/TBI_TX_CLK
add wave -noupdate -group {TBI I/F} -radix hexadecimal /testbench/dut_top/TBI_RX_CLK
add wave -noupdate -group {TBI I/F} -radix hexadecimal /testbench/dut_top/TCG
add wave -noupdate -group {TBI I/F} -radix hexadecimal /testbench/dut_top/RCG
add wave -noupdate -group {TBI I/F} -radix hexadecimal /testbench/dut_top/TBI_TX_VALID
add wave -noupdate -group {TBI I/F} -radix hexadecimal /testbench/dut_top/TBI_RX_VALID
add wave -noupdate -group {TBI I/F} -radix hexadecimal /testbench/dut_top/TBI_RX_READY
add wave -noupdate -group {TBI I/F} -radix hexadecimal /testbench/dut_top/SIGNAL_DETECT
add wave -noupdate -group {TBI I/F} -radix hexadecimal /testbench/dut_top/RX_SLIP
add wave -noupdate -group {TBI I/F} -radix hexadecimal /testbench/dut_top/SYNC
add wave -noupdate -group {TBI I/F} -radix hexadecimal /testbench/dut_top/ANX_STATE
add wave -noupdate -group {TBI I/F} -radix hexadecimal /testbench/dut_top/RCG_ERROR
add wave -noupdate -group {MDIO I/F} -radix hexadecimal /testbench/dut_top/MDC
add wave -noupdate -group {MDIO I/F} -radix hexadecimal /testbench/dut_top/MDI
add wave -noupdate -group {MDIO I/F} -radix hexadecimal /testbench/dut_top/MDO
add wave -noupdate -group {MDIO I/F} -radix hexadecimal /testbench/dut_top/MDOEN
add wave -noupdate -group {APB I/F} -radix hexadecimal /testbench/dut_top/PCLK
add wave -noupdate -group {APB I/F} -radix hexadecimal /testbench/dut_top/PRESETN
add wave -noupdate -group {APB I/F} -radix hexadecimal /testbench/dut_top/PADDR
add wave -noupdate -group {APB I/F} -radix hexadecimal /testbench/dut_top/PSEL
add wave -noupdate -group {APB I/F} -radix hexadecimal /testbench/dut_top/PENABLE
add wave -noupdate -group {APB I/F} -radix hexadecimal /testbench/dut_top/PWRITE
add wave -noupdate -group {APB I/F} -radix hexadecimal /testbench/dut_top/PWDATA
add wave -noupdate -group {APB I/F} -radix hexadecimal /testbench/dut_top/PREADY
add wave -noupdate -group {APB I/F} -radix hexadecimal /testbench/dut_top/PRDATA
add wave -noupdate -group {APB I/F} -radix hexadecimal /testbench/dut_top/PSLVERR
add wave -noupdate -group {AXI4S Target I/F} -radix hexadecimal /testbench/dut_top/AXI4S_TCLK
add wave -noupdate -group {AXI4S Target I/F} -radix hexadecimal /testbench/dut_top/AXI4S_TTVALID
add wave -noupdate -group {AXI4S Target I/F} -radix hexadecimal /testbench/dut_top/AXI4S_TTREADY
add wave -noupdate -group {AXI4S Target I/F} -radix hexadecimal /testbench/dut_top/AXI4S_TTSOF
add wave -noupdate -group {AXI4S Target I/F} -radix hexadecimal /testbench/dut_top/AXI4S_TTEOF
add wave -noupdate -group {AXI4S Target I/F} -radix hexadecimal /testbench/dut_top/AXI4S_TTDATA
add wave -noupdate -group {AXI4S Target I/F} -radix hexadecimal /testbench/dut_top/AXI4S_TTKEEP
add wave -noupdate -group {AXI4S Target I/F} -radix hexadecimal /testbench/dut_top/AXI4S_TTLAST
add wave -noupdate -group {AXI4S Initiator I/F} -radix hexadecimal /testbench/dut_top/AXI4S_ICLK
add wave -noupdate -group {AXI4S Initiator I/F} -radix hexadecimal /testbench/dut_top/AXI4S_ITVALID
add wave -noupdate -group {AXI4S Initiator I/F} -radix hexadecimal /testbench/dut_top/AXI4S_ITLAST
add wave -noupdate -group {AXI4S Initiator I/F} -radix hexadecimal /testbench/dut_top/AXI4S_ITREADY
add wave -noupdate -group {AXI4S Initiator I/F} -radix hexadecimal /testbench/dut_top/AXI4S_ITSOF
add wave -noupdate -group {AXI4S Initiator I/F} -radix hexadecimal /testbench/dut_top/AXI4S_ITEOF
add wave -noupdate -group {AXI4S Initiator I/F} -radix hexadecimal /testbench/dut_top/AXI4S_ITDATA
add wave -noupdate -group {AXI4S Initiator I/F} -radix hexadecimal /testbench/dut_top/AXI4S_ITKEEP
add wave -noupdate -group {AXI4S Initiator I/F} -radix hexadecimal /testbench/dut_top/AXI4S_ITUSER
add wave -noupdate -group {MISC Signals} -radix hexadecimal /testbench/dut_top/TSM_INTR
add wave -noupdate -group {MISC Signals} -radix hexadecimal /testbench/dut_top/TSM_CONTROL
add wave -noupdate -group {MISC Signals} -radix hexadecimal /testbench/dut_top/STBP
TreeUpdate [SetDefaultTree]
WaveRestoreCursors {{Cursor 1} {0 ps} 0}
quietly wave cursor active 0
configure wave -namecolwidth 227
configure wave -valuecolwidth 100
configure wave -justifyvalue left
configure wave -signalnamewidth 1
configure wave -snapdistance 10
configure wave -datasetprefix 0
configure wave -rowmargin 4
configure wave -childrowmargin 2
configure wave -gridoffset 0
configure wave -gridperiod 1
configure wave -griddelta 40
configure wave -timeline 0
configure wave -timelineunits ps
update
WaveRestoreZoom {0 ps} {241501050 ps}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,167 @@
//`define MCXMAC_SGMII_ON //Default mode enabled
//`define MCXMAC_SAL_ON //enable SAL support in tsMac
//`define MCXMAC_PTP_ON //enable PTP support in tsMac
//`define MCXMAC_STATS_ON //enable Stats counter module
//`define MCXMAC_WOL_ON //enable WakeOnLane feature of MAC core
//`define MSGMII_PARALLEL_COMMA_ALIGNMENT //enable sgmii-CommaDetect logic
//`define TABITS 12 //mac-fifo TxBuffer addr-width, For depth of the fifo
//`define RABITS 12 //mac-fifo RxBuffer addr-width, For depth of the fifo
//`define MII_PHYID 5'h1E //Address of local MDIO target, for registers in SGMII module
//`define FPGA_TIMING_CLOSER
`define HST_SELECT_MAHBE 3'b011 // HSTADX range 0x180 - 0x19C
`define HST_SELECT_PTP 3'b100 // HSTADX range 0x200 - 0x27F
`define HST_SELECT_EEE 5'b10_100 // HSTADX range 0x280 - 0x29F
`define HST_SELECT_AVB 5'b10_101 // HSTADX range 0x2A0 - 0x
// MAHBe address map
`define ADDR_LEF_TXCTRL 0
`define ADDR_LEF_TXDESC 1
`define ADDR_LEF_TXSTAT 2
`define ADDR_LEF_RXCTRL 3
`define ADDR_LEF_RXDESC 4
`define ADDR_LEF_RXSTAT 5
`define ADDR_LEF_IMASK 6
`define ADDR_LEF_INTR 7
`define ADDR_AVB_TXCTRL 8
`define ADDR_AVB_TXDESC 9
`define ADDR_AVB_TXSTAT 10
`define ADDR_AVB_RXCTRL 11
`define ADDR_AVB_RXDESC 12
`define ADDR_AVB_RXSTAT 13
`define ADDR_AVB_IMASK 14
`define ADDR_AVB_INTR 15
//============================================
// for 1 queue
//============================================
`define ADDR_TX_CMD_REG 0
`define ADDR_TX_CDP_0 1
`define ADDR_TX_STS_REG 2
`define ADDR_RX_CMD_REG 3
`define ADDR_RX_CDP_0 4
`define ADDR_RX_STS_REG 5
// `ifdef SGDMA_AXI_ON
`define ADDR_IMASK 6
`define ADDR_INTR 7
// //`endif
// `ifdef SGDMA_AHB_ON
//`define ADDR_IMASK 6
//`define ADDR_INTR 7
`define H_IDLE 2'b00 // idle transfer
`define H_BUSY 2'b01 // busy transfer
`define H_NONSEQ 2'b10 // non-sequential transfer
`define H_SEQ 2'b11 // sequential transfer
// AHB responses
`define H_OKAY 2'b00 // transfer completed successfully
`define H_ERROR 2'b01 // an error has occurred
`define H_RETRY 2'b10 // transfer cannot be completed yet
`define H_SPLIT 2'b11 // split (not used in this design)
// AHB size encodings
`define H_BYTE 2'b00 // byte wide
`define H_HWORD 2'b01 // half-word (16-bits) wide
`define H_WORD 2'b10 // word (32-bits) wide
`define MAX_PKT_SIZE 1536 // maximum packet size
//======================================================================
// Sibridge Technologies
// Proprietary and Confidential
// All Rights Reserved
//======================================================================
// FILE : $Source: $
// REVISION : $Revision: 46073 $
// LAST UPDATE : $Date: 2024-02-13 12:34:42 +0530 (Tue, 13 Feb 2024) $
//======================================================================
// AUTHOR : Sibridge Technologies
// MODULE NAME : ptp_hstif
// DESCRIPTION : PTP-1588 Module Host Interface which interacts with the AHB
// target Interface. All the Registers and FIFOs are implemented in this module.
//======================================================================
//`define ASYNC_RESET // Type of reset used for FIFO used in ptp_hstif.
//Register Address Map.
`define TS_RD_REG1_ADDR 5'b00000
`define TS_RD_REG2_ADDR 5'b00001
`define TS_RD_REG3_ADDR 5'b00010
`define TS_WR_REG1_ADDR 5'b00011
`define TS_WR_REG2_ADDR 5'b00100
`define TS_WR_REG3_ADDR 5'b00101
`define EVNT1_REG1_ADDR 5'b00110
`define EVNT1_REG2_ADDR 5'b00111
`define EVNT1_REG3_ADDR 5'b01000
`define EVNT2_REG1_ADDR 5'b01001
`define EVNT2_REG2_ADDR 5'b01010
`define EVNT2_REG3_ADDR 5'b01011
`define EVNT1_PLS_WDTH_REG_ADDR 5'b01100
`define EVNT2_PLS_WDTH_REG_ADDR 5'b01101
`define CMD_REG_ADDR 5'b01110
`define CNFG_REG_ADDR 5'b01111
`define INTRPT_REG_ADDR 5'b10000
`define INTRPT_MASK_REG_ADDR 5'b10001
`define RTC_CLK1SEL_REG_ADDR 5'b10010
`define RTC_CLK2SEL_REG_ADDR 5'b10011
`define RX_RCRD_FIFO_ADDR 5'b10100
`define TX_RCRD_FIFO_ADDR 5'b10101
`define ADJST_REG_ADDR 5'b10110
`define LT0L_REG_ADDR 5'b10111
`define LT0M_REG_ADDR 5'b11000
`define LT1L_REG_ADDR 5'b11001
`define LT1M_REG_ADDR 5'b11010
`define LT2L_REG_ADDR 5'b11011
`define LT2M_REG_ADDR 5'b11100
//Register Fields.
`define FLD_INTRP_REG_PPS 0 // Time stamp write interrupt bit in INTERRUPT REG.
`define FLD_INTRP_REG_MODE_ERR 1 // MODE ERROR interrupt bit in INTERRUPT REG.
`define FLD_INTRP_REG_TS_WRDONE 2 // TS WRITE DONE interrupt bit in INTERRUPT REG.
`define FLD_INTRP_REG_TX_RCRDDONE 3 // PTP MSG TRANSMIT DONE interrupt bit in INTERRUPT REG.
`define FLD_INTRP_REG_RX_RCRDDONE 4 // PTP MSG RECEIVE DONE interrupt bit in INTERRUPT REG.
`define FLD_INTRP_REG_TX_THSHLD 5 // TX FIFO THRSHLD FULL interrupt bit in INTERRUPT REG.
`define FLD_INTRP_REG_RX_THSHLD 6 // RX FIFO THRSHLD FULL interrupt bit in INTERRUPT REG.
`define FLD_INTRP_REG_LTOINT 7 // LATCH 0 interrupt bit in INTERRUPT REG.
`define FLD_INTRP_REG_LT1INT 8 // LATCH 1 interrupt bit in INTERRUPT REG.
`define FLD_INTRP_REG_LT2INT 9 // LATCH 2 interrupt bit in INTERRUPT REG.
`define FLD_INTRP_MASK_REG_INT_EN 0 // Glabal interupt Mask.
`define FLD_INTRP_MASK_REG_PPS 1 // Time stamp write interrupt mask bit in INTERRUPT MASK REG.
`define FLD_INTRP_MASK_REG_MODE_ERR 2 // MODE ERROR interrupt mask bit in INTERRUPT MASK REG.
`define FLD_INTRP_MASK_REG_TS_WRDONE 3 // TS WRITE DONE interrupt mask bit in INTERRUPT MASK REG.
`define FLD_INTRP_MASK_REG_TX_RCRDDONE 4 // PTP MSG TRANSMIT DONE interrupt mask bit in INTERRUPT MASK REG.
`define FLD_INTRP_MASK_REG_RX_RCRDDONE 5 // PTP MSG RECEIVE DONE interrupt mask bit in INTERRUPT MASK REG.
`define FLD_INTRP_MASK_REG_TX_THSHLD 6 // TX FIFO THRSHLD FULL interrupt mask bit in INTERRUPT MASK REG.
`define FLD_INTRP_MASK_REG_RX_THSHLD 7 // RX FIFO THRSHLD FULL interrupt mask bit in INTERRUPT MASK REG.
`define FLD_INTRP_MASK_REG_LTOINT 8 // LATCH 0 interrupt mask bit in INTERRUPT MASK REG.
`define FLD_INTRP_MASK_REG_LT1INT 9 // LATCH 1 interrupt mask bit in INTERRUPT MASK REG.
`define FLD_INTRP_MASK_REG_LT2INT 10 // LATCH 2 interrupt mask bit in INTERRUPT MASK REG.
`define FLD_CNFG_REG_EN 0 // MODULE ENABLE bit in CONFIGURATION REG.
`define FLD_CNFG_REG_RTCEN 1 // RTC ENABLE bit in CONFIGURATION REG.
`define FLD_CNFG_REG_MODE 2 // MODE bit in CONFIGURATION REG.
`define FLD_CNFG_REG_WRCMDEN 3 // TIME STAMP WRITE COMMAND ENABLE bit in CONFIGURATION REG.
`define FLD_CNFG_REG_EVNT1_TRGEN 4 // TIME TRIGGERED EVENT1 ENBALE bit in CONFIGURATION REG.
`define FLD_CNFG_REG_EVNT2_TRGEN 5 // TIME TRIGGERED EVENT2 ENBALE bit in CONFIGURATION REG.
`define FLD_CNFG_REG_RTCFREQ 6 // FREQ of REAL TIME COUNTER. 0 - 125 MHz, 1 - 250 MHz
`define FLD_CNFG_REG_TSWRMODE 7 // MODE OF TIME STAMP WRITE 0 - On Rising Edge of 1Hz CLK, 1 - DONOT wait for 1Hz clock rising edge.
`define FLD_CNFG_REG_DRIFTCRCT 8 // MODE OF TIME STAMP WRITE 0 - On Rising Edge of 1Hz CLK, 1 - DONOT wait for 1Hz clock rising edge.
`define FLD_CNFG_REG_LT0EN 9 // RTC LATCH 0 ENABLE BIT.
`define FLD_CNFG_REG_LT1EN 10 // RTC LATCH 1 ENABLE BIT.
`define FLD_CNFG_REG_LT2EN 11 // RTC LATCH 2 ENABLE BIT.
`define FLD_CNFG_REG_SFTRST 12 // SOFT RESET FOR PTP MODULE.
`define FLD_CMD_REG_TSWRCMD 0 // TIME STAMP WRITE COMMAND bit in COMMAND REG.
`define FLD_ADJST_REG_EN 0 // RTC FREQUENCY ADJUSTMENT ENABLE BIT.
`define FLD_ADJST_REG_VLU_LSB 1 // RTC FREQUENCY ADJUSTMENT VALUE LSB.
`define FLD_ADJST_REG_VLU_MSB 7 // RTC FREQUENCY ADJUSTMENT VALUE MSB.
`define FLD_ADJST_REG_FREQ_LSB 8 // RTC FREQUENCY ADJUSTMENT FREQUENCY VALUE LSB.
`define FLD_ADJST_REG_FREQ_MSB 31 // RTC FREQUENCY ADJUSTMENT FREQUENCY VALUE MSB.
//`define ASYNC_1HZ_CLK // Represents 1Hz clock is asynchronous to RTC clock.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,364 @@
// **************************************************************************
// Microchip Corporation Proprietary and Confidential
// Copyright 2021 Microchip Corporation. All rights reserved.
//
// ANY USE OR REDISTRIBUTION IN PART OR IN WHOLE MUST BE HANDLED IN
// ACCORDANCE WITH THE MICROCHIP LICENSE AGREEMENT AND MUST BE APPROVED
// IN ADVANCE IN WRITING.
//
// Description : CoreTSE testbench top level module for TBI mode.
//
// SVN Revision Information :
// SVN $Revision : $
// SVN $Date : $
//
// Revision Information :
// Date SAR Description
//
// Notes :
//
// **************************************************************************
`timescale 1 ns / 100 ps
// ==========================================================================
// testbench
// ==========================================================================
module testbench ;
// --------------------------------------------------------------------------
// coreparameters file
`include "coreparameters.v"
// --------------------------------------------------------------------------
// Internal Signal
wire ftclk ;
wire ftrdy ;
wire ftacpt ;
wire ftsof ;
wire fteof ;
wire [31:0] ftdat ;
wire [ 1:0] ftdatnvld ;
wire ftcfrm ;
wire fthwm ;
wire frclk ;
wire frrdy ;
wire fracpt ;
wire frsof ;
wire freof ;
wire [31:0] frdat ;
wire [ 1:0] frdatnvld ;
reg [ 1:0] frdatnvld_axi4s ;
wire mac_tx_clk;
wire mac_rx_clk;
wire axi4s_tclk ;
wire axi4s_ttvalid ;
wire axi4s_ttready ;
wire axi4s_ttsof ;
wire axi4s_tteof ;
wire [31:0] axi4s_ttdata ;
reg [ 3:0] axi4s_ttkeep ;
wire axi4s_ttlast ;
wire axi4s_iclk ;
wire axi4s_itvalid ;
wire axi4s_itready ;
wire axi4s_itsof ;
wire axi4s_iteof ;
wire [31:0] axi4s_itdata ;
reg [ 3:0] axi4s_itkeep ;
wire axi4s_itlast ;
wire [ 7:0] axi4s_ituser ;
wire tx_clk ;
wire rx_clk ;
wire tbi_tx_clk ;
wire tbi_rx_clk ;
wire [ 9:0] tcg_dut ;
wire [ 9:0] rcg_dut ;
wire mdc ;
wire mdi ;
wire mdo ;
wire mdoen ;
wire pclk ;
wire presetn ;
wire [31:0] paddr ;
wire psel ;
wire penable ;
wire pwrite ;
wire [31:0] pwdata ;
wire pready ;
wire [31:0] prdata ;
wire pslverr ;
wire rstbp ;
reg axi4s_itsop_det_en = 1'b1;
// --------------------------------------------------------------------------
// DUT Instantiation
CORETSE
# (
.FAMILY ( FAMILY ) ,
.GMII_TBI ( GMII_TBI ) ,
.PACKET_SIZE ( PACKET_SIZE ) ,
.SAL ( SAL ) ,
.WoL ( WoL ) ,
.STATS ( STATS ) ,
.MDIO_PHYID ( MDIO_PHYID ) ,
.SLIP_ENABLE ( SLIP_ENABLE ) ,
.ECC_ENABLE ( ECC_ENABLE ) ,
.TXRX_INTR_ENABLE ( TXRX_INTR_ENABLE ) ,
.HOST_INTERFACE ( HOST_INTERFACE )
) dut_top (
.MTXCLK ( mac_tx_clk ) ,
.MTXRDY ( ftrdy ) ,
.MTXACPT ( ftacpt ) ,
.MTXSOF ( ftsof ) ,
.MTXEOF ( fteof ) ,
.MTXDAT ( ftdat ) ,
.MTXBYTEVALID ( ftdatnvld ) ,
.MTXCFRM ( ftcfrm ) ,
.MTXHWM ( fthwm ) ,
.MRXCLK ( mac_rx_clk ) ,
.MRXRDY ( frrdy ) ,
.MRXACPT ( fracpt ) ,
.MRXSOF ( frsof ) ,
.MRXEOF ( freof ) ,
.MRXDAT ( frdat ) ,
.MRXBYTEVALID ( frdatnvld ) ,
.AXI4S_TCLK ( axi4s_tclk ) ,
.AXI4S_TTVALID ( axi4s_ttvalid ) ,
.AXI4S_TTREADY ( axi4s_ttready ) ,
//.AXI4S_TTSOF ( axi4s_ttsof ) ,
//.AXI4S_TTEOF ( axi4s_tteof ) ,
.AXI4S_TTDATA ( axi4s_ttdata ) ,
.AXI4S_TTKEEP ( axi4s_ttkeep ) ,
.AXI4S_TTLAST ( axi4s_ttlast ) ,
.AXI4S_ICLK ( axi4s_iclk ) ,
.AXI4S_ITVALID ( axi4s_itvalid ) ,
.AXI4S_ITREADY ( axi4s_itready ) ,
//.AXI4S_ITSOF ( axi4s_itsof ) ,
//.AXI4S_ITEOF ( axi4s_iteof ) ,
.AXI4S_ITDATA ( axi4s_itdata ) ,
.AXI4S_ITKEEP ( axi4s_itkeep ) ,
.AXI4S_ITLAST ( axi4s_itlast ) ,
.AXI4S_ITUSER ( axi4s_ituser ) ,
//.GTXCLK ( ) ,
.TXCLK ( tx_clk ) ,
.RXCLK ( rx_clk ) ,
.TXEN ( ) ,
.TXD ( ) ,
.TXER ( ) ,
.RXDV ( ) ,
.RXD ( ) ,
.RXER ( ) ,
.CRS ( ) ,
.COL ( ) ,
.TBI_TX_CLK ( tbi_tx_clk ) ,
.TBI_RX_CLK ( tbi_rx_clk ) ,
.TCG ( tcg_dut ) ,
.RCG ( rcg_dut ) ,
.TBI_TX_VALID ( ) ,
.TBI_RX_VALID ( ) ,
.TBI_RX_READY ( 1'b1 ) ,
.SIGNAL_DETECT ( 1'b1 ) ,
.RX_SLIP ( ) ,
.SYNC ( ) ,
.ANX_STATE ( ) ,
.RCG_ERROR ( ) ,
.MDC ( mdc ) ,
.MDI ( mdi ) ,
.MDO ( mdo ) ,
.MDOEN ( mdoen ) ,
.PCLK ( pclk ) ,
.PRESETN ( presetn ) ,
.PADDR ( paddr ) ,
.PSEL ( psel ) ,
.PENABLE ( penable ) ,
.PWRITE ( pwrite ) ,
.PWDATA ( pwdata ) ,
.PRDATA ( prdata ) ,
.PSLVERR ( pslverr ) ,
.PREADY ( pready ) ,
.TSM_INTR ( ) ,
.TSM_CONTROL ( ) ,
.FAULT_DET ( )
//.STBP ( rstbp )
) ;
// --------------------------------------------------------------------------
// Frame Generator and Checker Instantiation
generate if (HOST_INTERFACE == 0) begin : NATIVE
CoreTSE_tb
# (
.MDIO_PHYID ( MDIO_PHYID )
) frame_gen_chk (
.ftclk ( ftclk ) ,
.ftrdy ( ftrdy ) ,
.ftacpt ( ftacpt ) ,
.ftsof ( ftsof ) ,
.fteof ( fteof ) ,
.ftdat ( ftdat ) ,
.ftdatnvld ( ftdatnvld ) ,
.fthwm ( fthwm ) ,
.ftcfrm ( ftcfrm ) ,
.frclk ( frclk ) ,
.frrdy ( frrdy ) ,
.fracpt ( fracpt ) ,
.frsof ( frsof ) ,
.freof ( freof ) ,
.frdat ( frdat ) ,
.frdatnvld ( frdatnvld ) ,
.tx_clk ( tx_clk ) ,
.rx_clk ( rx_clk ) ,
.tbi_tx_clk ( tbi_tx_clk ) ,
.tbi_rx_clk ( tbi_rx_clk ) ,
.tcg_dut ( tcg_dut ) ,
.rcg_dut ( rcg_dut ) ,
.mdc ( mdc ) ,
.mdi ( mdi ) ,
.mdo ( mdo ) ,
.mdoen ( mdoen ) ,
.pclk ( pclk ) ,
.presetn ( presetn ) ,
.paddr ( paddr ) ,
.psel ( psel ) ,
.penable ( penable ) ,
.pwrite ( pwrite ) ,
.pwdata ( pwdata ) ,
.pready ( pready ) ,
.prdata ( prdata ) ,
.pslverr ( pslverr ) ,
.rstbp ( rstbp )
) ;
assign mac_tx_clk = ftclk ;
assign mac_rx_clk = frclk ;
assign axi4s_tclk = 0 ;
assign axi4s_ttvalid = ftrdy ;
assign axi4s_ttsof = ftsof ;
assign axi4s_tteof = fteof ;
assign axi4s_ttdata = ftdat ;
assign axi4s_ttkeep = 4'd0 ;
assign axi4s_ttlast = 1'd0 ;
assign axi4s_iclk = 0 ;
assign axi4s_itready = fracpt ;
end else begin : AXI4Stream
CoreTSE_AXI4S_tb
# (
.MDIO_PHYID ( MDIO_PHYID )
) frame_gen_chk (
.ftclk ( ftclk ) ,
.ftrdy ( ftrdy ) ,
.ftacpt ( axi4s_ttready ) ,
.ftsof ( ftsof ) ,
.fteof ( fteof ) ,
.ftdat ( ftdat ) ,
.ftdatnvld ( ftdatnvld ) ,
.fthwm ( fthwm ) ,
.ftcfrm ( ftcfrm ) ,
.frclk ( frclk ) ,
.frrdy ( axi4s_itvalid ) ,
.fracpt ( axi4s_itready ) ,
.frsof ( axi4s_itsof ) ,
.freof ( axi4s_iteof ) ,
.frdat ( axi4s_itdata ) ,
.frdatnvld ( frdatnvld_axi4s ) ,
.tx_clk ( tx_clk ) ,
.rx_clk ( rx_clk ) ,
.tbi_tx_clk ( tbi_tx_clk ) ,
.tbi_rx_clk ( tbi_rx_clk ) ,
.tcg_dut ( tcg_dut ) ,
.rcg_dut ( rcg_dut ) ,
.mdc ( mdc ) ,
.mdi ( mdi ) ,
.mdo ( mdo ) ,
.mdoen ( mdoen ) ,
.pclk ( pclk ) ,
.presetn ( presetn ) ,
.paddr ( paddr ) ,
.psel ( psel ) ,
.penable ( penable ) ,
.pwrite ( pwrite ) ,
.pwdata ( pwdata ) ,
.pready ( pready ) ,
.prdata ( prdata ) ,
.pslverr ( pslverr ) ,
.rstbp ( rstbp )
) ;
assign mac_tx_clk = 0 ;
assign mac_rx_clk = 0 ;
assign axi4s_tclk = ftclk ;
assign axi4s_ttvalid = ftrdy ;
assign axi4s_ttsof = ftsof ;
assign axi4s_tteof = fteof ;
assign axi4s_ttdata = ftdat ;
always @(*) begin
case(ftdatnvld)
4'b0001 : frdatnvld_axi4s = 2'b11;
4'b0011 : frdatnvld_axi4s = 2'b10;
4'b0111 : frdatnvld_axi4s = 2'b01;
default : frdatnvld_axi4s = 2'b00;
endcase
end
always @(*) begin
case(ftdatnvld)
2'b11 : axi4s_ttkeep = 4'b0001;
2'b10 : axi4s_ttkeep = 4'b0011;
2'b01 : axi4s_ttkeep = 4'b0111;
default : axi4s_ttkeep = 4'b1111;
endcase
end
assign axi4s_ttlast = fteof ;
assign axi4s_iclk = frclk ;
assign axi4s_itready = fracpt ;
// Initiator SOF & EOF Generation
always @(posedge axi4s_iclk) begin
if (axi4s_itsof & axi4s_itready)
axi4s_itsop_det_en <= 1'b0;
else if (axi4s_itlast & axi4s_itready)
axi4s_itsop_det_en <= 1'b1;
end
assign axi4s_itsof = axi4s_itsop_det_en & axi4s_itvalid;
assign axi4s_iteof = axi4s_itvalid & axi4s_itlast;
end
endgenerate
endmodule
// --------------------------------------------------------------------------