Add synthesizable pulse_gen Vivado deliverables (RTL, self-checking TB, constraints, and sim flow)#1
Merged
Conversation
Copilot
AI
changed the title
[WIP] Build complete Vivado project for pulse generator module
Add synthesizable Jul 11, 2026
pulse_gen Vivado deliverables (RTL, self-checking TB, constraints, and sim flow)
a0ax
marked this pull request as ready for review
July 11, 2026 17:53
Copilot stopped reviewing on behalf of
a0ax due to an error
July 11, 2026 17:54
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a parameterized pulse generator RTL block plus a self-checking simulation testbench and scripts/docs to run simulation and basic Vivado flow.
Changes:
- Added
pulse_gen.svRTL for periodic pulse generation (width/period/enable, busy output). - Added SystemVerilog testbench
tb_pulse_gen.svand a simulator scriptscripts/sim.doto run it (Questa or Vivado xsim). - Added Vivado constraints for
clkand expanded README with simulation/implementation commands.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| sim/tb_pulse_gen.sv | New self-checking SV testbench for pulse_gen. |
| sim/results.txt | Documents expected waveform behavior for key configurations. |
| scripts/sim.do | Adds a unified script attempting to run in Questa or Vivado xsim. |
| rtl/pulse_gen.sv | New parameterized pulse generator RTL implementation. |
| constraints/pulse_gen.xdc | Adds a 100 MHz clock constraint and pin/IO standard for clk. |
| README.md | Adds instructions for running simulation and Vivado implementation/timing checks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+32
to
+37
| task automatic expect_equal(input string tag, input bit got, input bit exp); | ||
| if (got !== exp) begin | ||
| $error("%s mismatch: got=%0b exp=%0b at t=%0t", tag, got, exp, $time); | ||
| errors++; | ||
| end | ||
| endtask |
Comment on lines
+41
to
+45
| for (i = 0; i < cycles; i++) begin | ||
| @(posedge clk); | ||
| expect_equal("busy", busy, (enable && (w != 0) && (p != 0))); | ||
| expect_equal("pulse", pulse, ((i % p) < ((w < p) ? w : p))); | ||
| end |
Comment on lines
+17
to
+22
| always_comb begin | ||
| if (width >= period) | ||
| width_eff = period; | ||
| else | ||
| width_eff = {{(PERIOD_BITS-WIDTH_BITS){1'b0}}, width}; | ||
| end |
Comment on lines
+1
to
+5
| if {[info commands vlog] ne ""} { | ||
| vlib work | ||
| vlog -sv ../rtl/pulse_gen.sv ../sim/tb_pulse_gen.sv | ||
| vsim -c tb_pulse_gen -do "run -all; quit -f" | ||
| } elseif {[info commands xvlog] ne ""} { |
| # QubitPulseGenerator No newline at end of file | ||
| # QubitPulseGenerator | ||
|
|
||
| - Run simulation (Questa or Vivado xsim): `cd scripts && vsim -c -do sim.do` or `vivado -mode batch -source sim.do`. |
a0ax
added a commit
that referenced
this pull request
Jul 18, 2026
a0ax
added a commit
that referenced
this pull request
Jul 18, 2026
a0ax
added a commit
that referenced
this pull request
Jul 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a complete Artix-7-targeted Vivado deliverable set for a parameterized SystemVerilog pulse generator (
pulse_gen) using 100 MHz timing assumptions (10 ns units). It includes RTL, self-verifying simulation collateral, constraints, and concise build/timing guidance.RTL:
pulse_genimplementationrtl/pulse_gen.svwith parameterized counters (WIDTH_BITS=8,PERIOD_BITS=16).pulsehigh forwidthcycles perperiodcycle windowbusyasserted while actively generatingwidth >= period.Verification: self-checking testbench
sim/tb_pulse_gen.svwith automated checks for:pulseduty/period pattern andbusystatus over long-cycle scenarios.Vivado collateral
constraints/pulse_gen.xdcwith 100 MHz clock constraint (create_clock -period 10.000onclk).scripts/sim.dosupporting both Questa (vlog/vsim) and Vivado simulator (xvlog/xelab/xsim) invocation paths.README.mdwith concise simulation/project/implementation/timing-report instructions (including Fmax > 100 MHz expectation from timing summary).sim/results.txtwith expected waveform behavior summary from a mental run.Original prompt