How pcie-bench/pcie-model works
Main Components
• PCIe Model (model/pcie.py): Handles calculations regarding PCIe specifications.
• Memory Bandwidth Model (model/mem_bw.py): Calculates bandwidth for memory read/write PCIe transactions.
• NIC Models:
⁃ Simple NIC (model/simple_nic.py): Models the basic data transactions of a simple network interface controller.
⁃ Niantic NIC (model/niantic.py): Models a modern, more realistic 10Gb/s NIC including batched DMA transactions.
• Additional Utilities (model/util.py) and any smaller supporting parts (model/eth.py might be for Ethernet-related behavior).
• Sample Application Layer – Represented by the two top-level sample programs:
• pcie_bw.py: Provides an interface to calculate and plot PCIe bandwidth at the TLP layer. This also relies on the memory bandwidth model.
• nic_bw.py: Demonstrates bandwidth estimation for NICs using both the simple NIC and Niantic models.
Relationships and Interactions
• Data Flow:
• User Inputs/Configurations → Sample Programs (pcie_bw.py, nic_bw.py).
• The sample programs call into the corresponding models housed within the “model” directory.
• Within the models, components such as PCIe, Memory, and NIC interact – for example, the NIC models combine PCIe transactions and memory data transfers into an overall bandwidth calculation.
• After computing, the sample programs output data which is then plotted via the associated gnuplot files.
• From sample programs (top level) to core modeling components.
• Within the “model” folder, show the call hierarchy and data dependencies among “pcie.py”, “mem_bw.py”, “simple_nic.py”, “niantic.py”, and supporting utility functions in “util.py”.
Important Architectural Patterns
• Modular Design: The project separates concerns by having self-contained modeling modules and independent sample applications.
• Simulated Data Flow: The process starts with input from the user (or preset configuration parameters), flows through the simulation model, and then results in data that can be visualized. This sequence mimics pipelined calculations.
• Extensibility: The separation of different NIC models (simple, Niantic) shows that the framework is designed to easily add more models or modify existing ones.
Relevant Technologies and Domain Concepts
• Mention that the simulation is based on PCIe hardware specifications (e.g., lanes, generation, MPS, MRRS).
• That gnuplot is used for output visualization.
• Algorithmic or performance considerations detailed in the SIGCOMM 2018 paper referenced in the README.