How to Integrate the Pix2PGP Core in Your ASIC
This page describes how to drop the Pix2PGP core into an ASIC design. The core is a VHDL design that is expected to be instantiated inside the digital section of the ASIC, one instance per data lane (typically one per PGP4 transmitter / serializer).
The top-level entity is Pix2PgpTop, defined in
gateware/shared/rtl/Pix2PgpTop.vhd. It is intentionally kept
simple-port (std_logic / std_logic_vector only on the
data-facing side) so it can be instantiated from a SystemVerilog /
Verilog wrapper without record-type friction. The only VHDL records
appearing on its interface are the small config / readback and
AxiStreamMaster / Slave records — see the port table below.
Prerequisites
A per-ASIC package file (
Pix2PgpAsicPkg.vhd) that defines the ASIC-scoped constants Pix2PGP reads (see ASIC Core Architecture and How to Add Support for a New ASIC). The main knobs are:NUM_OF_COL_MANAGERS_C— how many columns each Pix2PGP instance servesNUM_OF_SERIALIZERS_C— how many Pix2PGP instances / lanes exist on the whole ASIC (used by the FPGA receiver — the ASIC core itself only cares aboutNUM_OF_COL_MANAGERS_C)ASIC_DATABUS_DWIDTH_C— the width of the data bus driven into Pix2PGP. Supported: 4, 8, 12, 16, 20, 24, 28, 32 bitsASIC_TYPE_C— a numeric identifier, propagated into the consolidated FPGA-side frame preambleINCR_TRGCNT_OVEROCC_C— whether the Trigger Counter should be incremented on an Over-Occupancy eventDATALEN_WIDTH_C/TRGCNT_WIDTH_C/TIMEOUT_LIMIT_WIDTH_C— bit widths of the countersEVAL_SOF_C/EVAL_EOFE_C— enable strict SoF / EoFE checking on the outbound AXI-StreamHEADER_WIDTH_MULT_C— header scaling factor if the natural doubled-bus width cannot fit the header bitfieldsThe header and column-metadata bitfield definitions
Two clocks:
sparseClk(User Logic domain) andpgpClk(Serializer / PGP domain) with their matching active-high resetsAn AXI-Stream slave downstream (a PGP4 transmitter for the standard use-case, or any other consumer if you want to wire Pix2PGP into a non-PGP transport)
Generics
Name |
Type |
Default |
Description |
|---|---|---|---|
|
|
|
Simulation-only propagation delay applied to registers. Ignored by synthesis |
|
|
|
|
|
|
|
Reset active-high ( |
|
|
|
Insert an extra pipeline stage on the Arbiter → PGP TX data path. Enable when timing on the AXI-Stream to the PGP4 transmitter is tight |
|
|
|
Insert an extra pipeline stage on the Column Supervisor / Arbiter status buses. Usually leave enabled |
|
|
|
Data FIFO depth per Column Manager, as |
|
|
|
Status FIFO depth per Column Manager, as |
|
|
|
Number of pipeline registers on the Data FIFO output. Zero-latency reads are supported, but adding a pipeline stage helps timing closure inside the core |
|
|
|
Number of pipeline registers on the Status FIFO output |
Ports
General Interface
Name |
Direction |
Description |
|---|---|---|
|
|
User Logic clock (matrix / sparse-logic domain). Drives the write-side of each Column Manager FIFO |
|
|
PGP / Serializer clock. Drives the Column Supervisor, the Arbiter, and the read-side of every FIFO |
|
|
Reset on the |
|
|
Reset on the |
|
|
|
|
|
|
Column Manager Interface
All of these ports are NUM_OF_COL_MANAGERS_C bits wide and share the
User Logic clock domain. They are the interface between Pix2PGP and the
per-column User Logic instances.
Name |
Direction |
Type |
Description |
|---|---|---|---|
|
|
|
Data bus. One
|
|
|
|
Per-column write-enable. Strobes a valid data word on |
|
|
|
Per-column Start-of-Frame. Opens a new event in that Column Manager and increments its Trigger Counter |
|
|
|
Per-column End-of-Frame. Closes the event nominally |
|
|
|
Per-column Over-Occupancy. Closes the current event and (for self-closure ASICs) opens the next one on the same cycle. See Over-Occupancy |
|
|
|
Per-column Pause acknowledgement from the User Logic. Confirms
to the Column Manager that the User Logic has seen the |
|
|
|
Per-column busy status. High while the Column Manager is actively processing an event |
|
|
|
Per-column Pause request driven back to the User Logic. Asserted when the Column Manager’s Data FIFO or Status FIFO reaches its almost-full threshold. See Pause (Back-Pressure) |
PGP4 TX Interface
Name |
Direction |
Description |
|---|---|---|
|
|
AXI-Stream master carrying the outbound Pix2PGP Lane Frame. Its
width is |
|
|
AXI-Stream slave handshake from the PGP4 transmitter |
Config record
Pix2PgpCfgConfigType (defined in
gateware/shared/rtl/Pix2PgpPkg.vhd) is the run-time configuration
record driven into Pix2PgpTop.config:
Field |
Width |
Description |
|---|---|---|
|
|
Per-column enable on the sparse / User-Logic side. Low disables writes into that Column Manager’s Data FIFO |
|
|
Per-column enable on the PGP / drain side. Low keeps the Arbiter from draining that Column Manager |
|
|
Watchdog limit (in PGP-clock cycles) used by the Column Supervisor in the Timeout Readout Sequence |
|
|
Pause-timeout limit (in PGP-clock cycles) used by the Column Supervisor to group paused columns together on ERO-closure ASICs |
A ready-made default value, DEFAULT_PIX2PGP_CONFIG_C, is exported
by the package. If you have no register-file infrastructure yet, wire
config <= DEFAULT_PIX2PGP_CONFIG_C to bring the core up.
Readback record
Pix2PgpCfgReadbackType — aggregated status returned on
Pix2PgpTop.readback:
Field |
Description |
|---|---|
|
Logical-OR of the per-column |
|
Logical-AND of the empty flags of every Column Manager Data FIFO |
|
Logical-AND of the empty flags of every Column Manager Status FIFO |
|
Column Supervisor busy flag |
|
Arbiter busy flag |
Wire these up to your ASIC’s slow-control read-back path if you want the core’s live state to be observable off-chip.
Instantiation Template
For an ASIC with 24 columns per Pix2PGP instance, 20-bit data words, and 8 lanes (SparkPix-S-style):
library ieee;
use ieee.std_logic_1164.all;
library surf;
use surf.StdRtlPkg.all;
use surf.AxiStreamPkg.all;
library pix2pgp;
use pix2pgp.Pix2PgpAsicPkg.all;
use pix2pgp.Pix2PgpPkg.all;
-- ...
U_Pix2PgpLane : entity pix2pgp.Pix2PgpTop
generic map (
TPD_G => 1 ns,
RST_ASYNC_G => true,
RST_POLARITY_G => '1',
PIPELINE_DATA_G => false,
PIPELINE_STATUS_G => true,
COLMANAGER_DATA_DEPTH_G => 7, -- 128 entries per column
COLMANAGER_STATUS_DEPTH_G => 6, -- 64 entries per column
DATAFIFO_PIPE_G => 1,
STATUSFIFO_PIPE_G => 1)
port map (
-- Clocks / resets
sparseClk => sparseClk,
pgpClk => pgpClk,
sparseRst => sparseRst,
pgpRst => pgpRst,
-- Config / readback
config => pix2pgpConfig,
readback => pix2pgpReadback,
-- Column Manager Interface (all NUM_OF_COL_MANAGERS_C-wide)
din => colDin,
wrEn => colWrEn,
sof => colSof,
eof => colEof,
overOcc => colOverOcc,
pauseAck => colPauseAck,
busy => colBusy,
pause => colPause,
-- PGP4 TX
pgpTxMaster => pgpTxMaster,
pgpTxSlave => pgpTxSlave);
Replicate this instantiation NUM_OF_SERIALIZERS_C times inside your
ASIC top-level, each connected to a distinct group of columns and to a
distinct PGP4 transmitter / serializer pair.
Instantiation Checklist
Both
sparseClkandpgpClkare physically driven and their frequencies match those declared inPix2PgpAsicPkg.vhdRST_POLARITY_Gmatches the polarity of the resets you feed inEvery element of
din(i)is exactlyASIC_DATABUS_DWIDTH_Cbits wide (VHDL synthesis will error out otherwise, but Verilog wrappers often silently truncate)The User Logic honours
pause— nowrEnmay be issued whilepauseis high;pauseAckshould mirror this. Failure to honour Pause causes Data / Status FIFO overflows and undefined behaviourThe AXI-Stream between
pgpTxMaster/pgpTxSlaveand the PGP4 transmitter carries the correcttKeep/tLastconventions. If you use SURF’sPgp4TxLite, wire directly; if you use a proprietary PGP transmitter, verify the AXI-Stream config record matchesconfigis stable during operation. If register writes are allowed at runtime, ensure theconfigfields are captured onpgpClkbefore being applied