Fixed FPGA_top.sv Format
Use this reference when generating the top-level scaffold.
Output Intent
The generated file is an HSB integration scaffold, not a complete project top. It instantiates HOLOLINK_top and declares HSB-facing signals according to the active HOLOLINK_def.svh macros. This file is a reference/template for hooking up top-level signals and companion IP to the HSB IP.
Required Order
Emit sections in this order:
- SPDX/Apache license header.
`include "HOLOLINK_def.svh".module FPGA_topdeclaration, normally with no top-level ports.- HSB-facing declarations in fixed section order.
HOLOLINK_topinstantiation.endmodule.
Module Shell
Use this shape unless the user explicitly asks for board ports:
`include "HOLOLINK_def.svh"
module FPGA_top
import HOLOLINK_pkg::*;
import apb_pkg::*;
#(
// Build identifier reported by HSB status/version registers:
// BUILD_REV[47:16] = build date, BUILD_REV[15:0] = build revision.
parameter BUILD_REV = 48'h0
)();Comment Banner
Use this baked banner style:
//------------------------------------------------------------------------------
// Section Name
//------------------------------------------------------------------------------Inside the HOLOLINK_top port map, use the same banner style for major groups and concise single-line comments for subgroups.
Signal Shape Rules
Preserve the HOLOLINK_top.sv declaration shape. Keep packed vector widths before the signal name and keep unpacked interface-array dimensions after the signal name. Do not collapse these ports into packed two-dimensional vectors.
Use this shape for multi-interface data buses:
logic [`DATAPATH_WIDTH-1:0] sif_rx_axis_tdata [`SENSOR_RX_IF_INST-1:0];
logic [`DATAKEEP_WIDTH-1:0] sif_rx_axis_tkeep [`SENSOR_RX_IF_INST-1:0];
logic [`DATAUSER_WIDTH-1:0] sif_rx_axis_tuser [`SENSOR_RX_IF_INST-1:0];
logic [`DATAPATH_WIDTH-1:0] sif_tx_axis_tdata [`SENSOR_TX_IF_INST-1:0];
logic [`DATAKEEP_WIDTH-1:0] sif_tx_axis_tkeep [`SENSOR_TX_IF_INST-1:0];
logic [`DATAUSER_WIDTH-1:0] sif_tx_axis_tuser [`SENSOR_TX_IF_INST-1:0];
logic [`HOST_WIDTH-1:0] hif_rx_axis_tdata [`HOST_IF_INST-1:0];
logic [`HOSTKEEP_WIDTH-1:0] hif_rx_axis_tkeep [`HOST_IF_INST-1:0];
logic [`HOSTUSER_WIDTH-1:0] hif_rx_axis_tuser [`HOST_IF_INST-1:0];
logic [`HOST_WIDTH-1:0] hif_tx_axis_tdata [`HOST_IF_INST-1:0];
logic [`HOSTKEEP_WIDTH-1:0] hif_tx_axis_tkeep [`HOST_IF_INST-1:0];
logic [`HOSTUSER_WIDTH-1:0] hif_tx_axis_tuser [`HOST_IF_INST-1:0];Do not emit this packed 2-D form for those buses:
logic [`SENSOR_RX_IF_INST-1:0][`DATAPATH_WIDTH-1:0] sif_rx_axis_tdata;
logic [`HOST_IF_INST-1:0][`HOST_WIDTH-1:0] hif_rx_axis_tdata;Use packed vectors for one-bit-per-interface signals:
logic [`SENSOR_RX_IF_INST-1:0] sif_rx_clk;
logic [`SENSOR_RX_IF_INST-1:0] sif_rx_rst;
logic [`SENSOR_RX_IF_INST-1:0] sif_rx_axis_tvalid;
logic [`SENSOR_RX_IF_INST-1:0] sif_rx_axis_tlast;
logic [`SENSOR_RX_IF_INST-1:0] sif_rx_axis_tready;
logic [`HOST_IF_INST-1:0] hif_rx_axis_tvalid;
logic [`HOST_IF_INST-1:0] hif_rx_axis_tlast;
logic [`HOST_IF_INST-1:0] hif_rx_axis_tready;Use the APB register interface shape from HOLOLINK_top.sv; only psel, pready, and pserr are per-REG_INST vectors, and only prdata is a 32-bit unpacked array:
logic [`REG_INST-1:0] apb_psel;
logic apb_penable;
logic [31:0] apb_paddr;
logic [31:0] apb_pwdata;
logic apb_pwrite;
logic [`REG_INST-1:0] apb_pready;
logic [31:0] apb_prdata [`REG_INST-1:0];
logic [`REG_INST-1:0] apb_pserr;When ENUM_EEPROM is undefined, declare the host-indexed MAC array as:
logic [47:0] mac_addr [`HOST_IF_INST-1:0];Declaration Sections
Emit these sections in order, omitting groups that are absent under the active defs macro set:
Clock and Reset
sys_rstapb_clk,apb_rsthif_clk,hif_rstptp_clk,ptp_rstsif_rx_clk,sif_rx_rstonly whenSENSOR_RX_IF_INSTis definedsif_tx_clk,sif_tx_rstonly whenSENSOR_TX_IF_INSTis defined
Comment
sif_rx_rstandsif_tx_rstat the declaration site. They are HSB outputs generated byHOLOLINK_top/reset_genin the corresponding sensor interface clock domain.User APB Interface
apb_pselapb_penableapb_paddrapb_pwdataapb_pwriteapb_preadyapb_prdataapb_pserr
Board Enumeration
- Only when
ENUM_EEPROMis undefined:mac_addr [HOST_IF_INST-1:0]board_snenum_vld
- Only when
Initialization
init_done
Sensor RX Interface
- Only when
SENSOR_RX_IF_INSTis defined:sif_rx_axis_tvalidsif_rx_axis_tlastsif_rx_axis_tdatasif_rx_axis_tkeepsif_rx_axis_tusersif_rx_axis_tready
- Only when
Sensor TX Interface
- Only when
SENSOR_TX_IF_INSTis defined:sif_tx_axis_tvalidsif_tx_axis_tlastsif_tx_axis_tdatasif_tx_axis_tkeepsif_tx_axis_tusersif_tx_axis_tready
- Only when
Sensor Event
sif_event
Host Interface
hif_rx_axis_*for data entering HSB from the host sidehif_tx_axis_*for data leaving HSB toward the host side
Peripheral Interfaces
- SPI only when
SPI_INSTis defined - I2C only when
I2C_INSTis defined - UART only when
UART_INSTis defined
- SPI only when
GPIO
gpio_ingpio_outgpio_dir
Sensor Reset
sw_sys_rstsw_sen_rst
PTP
- Always declare
ptp_clkandptp_rstin Clock and Reset. - When
EXT_PTPis undefined, declareptp_sec,ptp_nanosec, andppsas outputs from HSB. - When
EXT_PTPis defined, declare board-providedptp_secandptp_nanosecsignals and connect them to the live-sourcei_ptp_secandi_ptp_nanosecports.
- Always declare
Instantiation Rules
- Instantiate
HOLOLINK_topasu_hololink_top. - Pass
.BUILD_REV ( BUILD_REV ). - Preserve the
HOLOLINK_topport order from live source when available. - Include only ports present under the active macro set.
- Avoid trailing comma on the final active port connection.
- Use the same section order as the declarations.
- Do not connect absent optional ports.
Placeholder Policy
Do not invent project-specific drivers. Prefer declarations plus TODO comments:
// TODO: Drive sys_rst from board reset and clock/reset logic.
logic sys_rst;Use tie-offs only for clearly inert placeholders when the scaffold would otherwise be misleading, and call them out as placeholders. Do not tie off active sensor, host, APB, or clock paths as if that were complete integration.
Packetizer Comment Language
When packetizer fields are enabled, summarize them in terms of data manipulation behavior:
// TODO: Connect sif_rx_axis_* to the sensor-side source. Packetizer enabled
// (SIF_RX_PACKETIZER_EN[0]=1) with VP_COUNT=4, VP_SIZE=128,
// SORT_RESOLUTION=16, NUM_CYCLES=1 -- runtime APB programming routes
// virtual ports and controls the data manipulation behavior.Generated comments should keep packetizer wording generic and describe the configured data manipulation behavior.