Host-side TLM model of a PCIe switch: root complex, upstream port and crossbar are modeled in SystemC; downstream ports connect to the customer's DWC PCIe RTL through the private-port contract. No operating system and no HDL simulator are required for model-level use.
README.md this file
USER_GUIDE.md integration and API guide
include/ public headers (English)
lib/libpcie_switch_model.a binary model library
console/ standalone interactive console
rtl_bridge/ private-port adapter reference (.veo included)
The package already contains the binary model library and the public headers.
cd console && make && ./pcie_switch_consoleInside the console:
run all
cover
quit
- Configurable downstream ports (1..32) plus one dual-mode (DM) port; address-window routing
- Unicast, multicast, broadcast, peer-to-peer, NTB
- Standard PCIe Multicast extended capability (ECAP ID 0x0012) on switch ports: MC_Base/Index/NumGroups, MC_Receive, MC_Block_All/Untranslated and MC_Overlay_BAR; MC window wins over normal address routing; only posted memory writes; the legacy private MC (16 groups)/BC windows remain as fallback.
- Traversable extended-capability chain: every enabled ECAP is linked by
the header
Nextfield from 0x100 (SR-IOV or the standard DSN0x0003anchor). Standard register faces include AER, VC, DSN, ACS, ARI, ATS, SR-IOV, MC, ReBAR, PASID, DPC, LTR, L1SS, PTM, DOE, SPE/Secondary PCIe, Physical Layer 64 GT/s, Device 3, IDE, Flit Error Logging and Lane Margining. DPC is at 0x1B0 (no longer collides with SR-IOV). - Switch cascading: recursive enumeration with nested downstream windows
- Type0/Type1 configuration spaces, MSI / MSI-X / INTx
- No-OS enumeration with Linux-style
[ENUM]logging - Per-port, per-VC egress queues with strict-priority, round-robin and weighted round-robin arbitration; the standard VC ECAP exposes the TC/VC map and arbitration table.
- AER, PM/ASPM, FLR, ReBAR, ACS, ATS, PASID, 10-bit tag, VDM and atomic operations at the model level
- Root-complex host-memory face for endpoint-originated traffic: posted
writes are stored (byte-addressed, private-port per-dword byte order,
single- and multi-DW; write->read roundtrips are exact),
reads return CplDs from that store (or a default dword), reads outside the
backed window return UR, posted writes outside it are dropped and counted
(
up_memwr_oob), poisoned posted writes (TLPEP=1) are dropped and counted (up_memwr_poison), and MSI writes are matched against the IRQ table (the enumerator owns the IRQ window; test vectors must be registered after enumeration). On real-DWC ports (DspPortModule::radm_addr_reserved_low) incoming memory addresses are normalized to the PCIe[63:2]form — the private port'sradm_trgt1_addr[1:0]are header reserved bits; fake cores keep exact (byte-granular MSI-X) addresses. - Private-port co-simulation bridge and
+NO_FSDBdiagnostics
PHY, link training, equalization and flow control belong to the downstream RTL.
SPE, Physical Layer 64 GT/s, IDE, Flit Error Logging and Lane Margining are
configuration-space faces only; their link-training, encryption and flit-replay
semantics are not re-implemented in the model. The root-complex host memory is a model-side byte store in private-port
(per-dword MSB-first) byte order
(not an AXI4/DDR backend); the AXI4 host path lives in the separate VIP
co-simulation host. This model does not expose an
AXI4 interface in the switch package (the separate VIP co-simulation host has
its own AXI4 model/pin path), does not provide a DTS template or an example
program. See USER_GUIDE.md section 11 for details.
sh tlm/run.sh runs 31 gates = 31/31 PASS · 0 FAIL (2026-11-27),
including TB-MC-ECAP 18/18, TB-ECAP-CHAIN 118/118 and the new
TB-ATOM-RC (root-complex atomic execution, 11 green checks + 3 red
modes). Evidence: evidence/P137_ecap_chain_p0p4_20261122/
(run_30.log, status.txt) and evidence/P159_atom_rc_20261127/
(run_31_gates.log).
Model 1.1 -- the shipped configuration is recorded in USER_GUIDE.md
(section 8) and in the private-port adapter map.
2026-11-22: lib/libpcie_switch_model.a (12 objects), include/ (14 public
headers) and console/pcie_switch_console were rebuilt from the source tree
with the standard ECAP batch; console run all = 5/5 PASS.