Repository navigation
t27b verilog: inout ports and lane sets for ports wider than 64 bits (Closes #10187) - #10188
Merged
Merged
Conversation
Contributor
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.
Closes #10187. Refs #10024, #10170 (option A, step 1).
The t27b Verilog emitter can now write the top around a LiteDRAM core. It handles the 256-bit native port and the bidirectional DDR3 data bus. The parser does not change, and
MAX_WIDTHstays 64. Everything hand-written is .t27; the Rust undergen/is regenerated byt27c gen-rust.base__0 .. base__N, all of one type, adjacent and numbered from 0, become ONE instance port.base({laneN, ..., lane0}). Lane 0 goes in the low bits. Each output lane keeps its own wireinst__base__N. A set has at most 64 lanes (MAX_LANES).verilog_plan.t27(lane_at,lane_index,is_lane_of).verilog_emit.t27(put_instance,sibling).pub const X : T = undefined;is aninout wireport (classC_INOUT). It may only be handed by name to an instance port of type T (port_arg). Any other read is refused inex.failcalls input_instancetook a parameter's name fromtextwhen it lives inptext. They now passptext.specs/tri/t27b/conformance/verilog_wide_inout.t27. It models the shape of the LiteDRAM core: four 64-bit write lanes, four read lanes, a 32-bit inoutdq, andDATA_WIDTH = 256.Evidence (Railway lab, x86_64, branch at 194a926 plus the regenerated files)
Test reports. Each has 0 vacuous passes:
verilog_plan.t27verilog_emit.t27verilog_wide_inout.t27New tests:
a_lane_set_is_named_by_its_base_and_numbered_from_zero(plan)a_lane_set_is_one_port_and_an_inout_is_handed_through(emit, 13 asserts, including the refusals)hardware_only_consts_are_found_to_a_fixed_pointgen-rust.
t27bbuilds with them.t27b verilogon the conformance spec. The output has the portinout wire [31:0] ddr3_dqand this instance:Yosys (
read_verilog; proc; write_json):dq32,wdata256,rdata256,we1,ready1.DATA_WIDTH= 256.ddr3_dqhas direction inout, width 32.rdata[63:0]iscore__rdata__0andrdata[255:192]iscore__rdata__3.wdata[63:0]isbeat.Negative controls. Each one edits the conformance spec. Each exits 2 with an exact refusal that names the identifier:
wdata__7wdata__2rdata__9rdata__3wdata__1ddr3_dq, line 24u16portMutation controls. Each mutation is applied to the spec, then the test report is run. All 9 are killed:
pub"Base length unchecked" survived at first. The new assert
!is_lane_of("rdatax__2", ...)kills it.Corpus diff. The master
t27band the brancht27beach ranverilogon all 2,217 specs underspecs/, and stdout, stderr and exit codes were compared. 2,214 are identical. The 3 that differ are all expected:specs/tri/t27b/conformance/verilog_wide_inout.t27: the new spec.specs/port/tools/jtag/read_user1.t27:pub const CLK_BITS_OUT_NEG: u8 = undefined;and its sibling were input ports and are now inout.specs/port/tools/jtag/mpsse_jtag.t27: the refusal now says "inout" instead of "input" (exit 2 on both).Both JTAG specs are host-side tool specs, not hardware targets.
pub const ... = undefinedwas undocumented as a port form until now; the documented INPUT form is the non-pubconst X : T = undefined;, and it is unchanged.Seals. Resealed:
t27b_T27bVerilogPlan(17 tests)t27b_T27bVerilogEmitconformance_T27bConformanceVerilogWideInoutLedger.
docs/reports/t27b_expectations.jsongains the rowverilog_wide_inout.t27: pass.Not verified here
t27b nativeratchet in CI checks.🤖 Generated with Claude Code