-
Notifications
You must be signed in to change notification settings - Fork 15
WiP: a monolithic top level co-sim bench #127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
a6ff6d3
e0bbdc5
3f6543f
bf17d0b
6999789
99da3c1
230b4bf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| XRUN := xrun | ||
| XRUN_OPTS := -sv_ms \ | ||
| -dmsaoi \ | ||
| -timescale 1ps/1fs \ | ||
| -access +rwc \ | ||
| -iereport \ | ||
| -plusperf \ | ||
| -64bit \ | ||
| -spectre_args "+preset=cx +mt=32" \ | ||
|
||
| -CFLAGS "-std=c++11 -g" | ||
| VAMS_DIR := ../verilog | ||
| # SPECTRE_HOME := /tools/cadence/SPECTRE/SPECTRE251 | ||
| # XCELIUM_HOME := /tools/cadence/XCELIUM/XCELIUM2409.006/ | ||
| INCLUDES := -incdir $(VAMS_DIR) -incdir $(SPECTRE_HOME)/tools.lnx86/spectre/etc/ahdl | ||
| PHY_PROBE := probe.tcl | ||
|
|
||
| # Source files | ||
| DISCIPLINES := $(SPECTRE_HOME)/tools.lnx86/spectre/etc/ahdl/disciplines.vams | ||
| CONSTANTS := $(VAMS_DIR)/constants.vams | ||
| PRIMITIVES_SV := $(VAMS_DIR)/primitives.sv | ||
| PRIMITIVES_VAMS := $(VAMS_DIR)/primitives.vams | ||
| TX_SRC := $(VAMS_DIR)/tx.sv | ||
| TX_VAMS := $(VAMS_DIR)/tx.vams | ||
| RX_SRC := $(VAMS_DIR)/rx.sv | ||
| RX_VAMS := $(VAMS_DIR)/rx.vams | ||
| PHY_SRC := $(VAMS_DIR)/phy.sv | ||
| # bbpll.vams, dcdl.vams, s2d.vams, clock_distribution.vams | ||
| CLOCKING_SRC := $(VAMS_DIR)/dcdl.vams $(VAMS_DIR)/s2d.vams $(VAMS_DIR)/clock_distribution.vams | ||
|
|
||
|
|
||
| phy: | ||
| @echo "==========================================" | ||
| @echo "Running UCIePHY Testbench with xrun..." | ||
| @echo "==========================================" | ||
| $(XRUN) $(XRUN_OPTS) \ | ||
| $(DISCIPLINES) \ | ||
| $(CONSTANTS) \ | ||
| $(PRIMITIVES_VAMS) \ | ||
| $(TX_VAMS) \ | ||
| $(RX_VAMS) \ | ||
| $(PRIMITIVES_SV) \ | ||
| $(TX_SRC) \ | ||
| $(RX_SRC) \ | ||
| $(PHY_SRC) \ | ||
| $(CLOCKING_SRC) \ | ||
| amscf.scs \ | ||
| -reflib $(XCELIUM_HOME)/tools.lnx86/affirma_ams/etc/connect_lib/connectLib:uCR \ | ||
| -amsconnrules uCR \ | ||
| -top phy_tb \ | ||
| -input $(PHY_PROBE) | ||
| @echo "UCIePHY simulation completed. Waveforms: phy_waves.shm" | ||
| @echo "" | ||
|
|
||
| clean: | ||
| @echo "Cleaning simulation outputs..." | ||
| @rm -rf worklib *.log *.shm *.diag INCA_libs xcelium.d .simvision xrun.history .cadence worklibxrun amscf.ams | ||
| @echo "Clean complete." | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| # Xcelium UCIePHY Simulation Project | ||
|
|
||
| This directory contains the Xcelium simulation setup for the UCIePHY (Universal Chiplet Interconnect Express Physical Layer) testbench. The simulation uses mixed-signal (AMS + SystemVerilog) modeling to verify the PHY components. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| Before running the simulation, you **must** define the following environment variables to point to your Cadence tool installations: | ||
|
|
||
| - **SPECTRE_HOME**: Path to the Spectre installation directory. | ||
| - **AMS_HOME**: Path to the Xcelium AMS installation directory. | ||
|
|
||
| Without these variables, the Makefile will fail to locate necessary libraries and disciplines. | ||
|
|
||
| ## Running the Simulation | ||
|
|
||
| 1. Ensure you are in the `xcelium` directory. | ||
| 2. Set the environment variables as described above. | ||
| 3. Run the simulation: | ||
|
|
||
| ```bash | ||
| make phy | ||
| ``` | ||
|
|
||
| This will compile all AMS and SystemVerilog sources, elaborate the design, and run the testbench with the top-level module `phy_tb`. | ||
|
|
||
| ## Cleaning Up | ||
|
|
||
| To remove simulation artifacts (libraries, logs, waveforms): | ||
|
|
||
| ```bash | ||
| make clean | ||
| ``` | ||
|
|
||
| ## Files Overview | ||
|
|
||
| - **Makefile**: Defines the simulation flow using `xrun`. | ||
| - **amscf.scs**: AMS control file for Spectre integration. | ||
| - **probe.tcl**: Tcl script for waveform probing. | ||
| - **../verilog/**: Source files (AMS and SV) for the PHY components. | ||
|
|
||
| ## Notes | ||
|
|
||
| - The simulation uses mixed-signal mode (`-sv_ms`) to handle both analog (AMS) and digital (SystemVerilog) components. | ||
| - Waveforms are saved to `phy_waves.shm` upon completion. | ||
| - If you encounter permission or path errors, verify the environment variables and tool installations. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,10 +3,13 @@ | |
| // **************************************************************** | ||
| simulator lang=spectre | ||
|
|
||
| global 0 | ||
| global 0 vdd! | ||
|
|
||
| amsd { | ||
| ie vsup=0.75 tr=5p tf=5p rout=0 | ||
| ie vsup=0.75 tr=20p tf=20p rout=0 | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use 20ps for rise/fall for pessimistic estimation |
||
| } | ||
|
|
||
| tran tran stop=1u annotate=status | ||
|
|
||
| tran tran stop=1u noisefmax=64G noiseseed=32 annotate=status | ||
| // to disable noise, comment the above line and uncomment the line below | ||
| //tran tran stop=1u annotate=status | ||
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if a parameter is used in vams context, absolute scale (instead of relative scale specificed in timescale 1ps/1fs) has to be used