P11.5.2 A CRC That Takes 64 Bits per Clock

HardOptimizeIcarus Verilog + Yosys · serverReview the topic

Keep every CRC of a 64-bit-per-clock FCS engine and bring its depth from 23 levels of logic to a budget of 9.

Hardware context: An Ethernet MAC and physical coding sublayer: frame builder and checker, reconciliation sublayer and block encoder. Build, check and pace Ethernet frames, and code them for the physical layer as IEEE 802.3 specifies.

A typical 10 Gb/s MAC core moves eight octets per clock. Its FCS engine must then apply 64 CRC steps in one cycle. The engine below is correct. On the site's synthesis flow it measures 23 levels of logic, and the timing budget is 9.

This is an Optimize problem. Keep the function exactly; change the structure. Only the full eight-octet word is asked for here. A real MAC adds narrower updates for the last word of a frame.

The register is the one the lesson's bench uses. The generator is 04C11DB7h and bit 31 is the top. Each octet enters low bit first, octet 0 before octet 1.

Synthesis check: the design must build on the site's synthesis flow with no latch. An open-source flow counts levels of logic on its generic gates. That is a proxy for depth that ranks two codings of one design. It is not a delay and not a foundry result.

Signals in the Timeline

SignalWidthRole
test_number8input of each check
Full specification
The module (keep the name and the ports)
module crc64_next (
  input  logic [31:0] crc_in,     // the CRC-32 register before this word
  input  logic [63:0] data,       // eight octets; octet i is data[8*i +: 8], octet 0 first
  output logic [31:0] crc_out     // the register after all eight octets
);
  // your design
endmodule
CheckRule
Functioncrc_out equals 64 single-bit steps of the register, octet 0 first, each octet low bit first
Framesrun from all ones over the covered octets of a frame, the inverted result gives its FCS
Budgetat most 9 levels of logic on the pinned synthesis flow. The reference measures 7 and the starter 23. Cells have no budget
Latchesnone; the design is combinational

Examples

Example 1

One Data Bit
Input
crc_in = 0, data = 1
Output
crc_out = 0x79005533

Only bit 0 of octet 0 is set. The result is the column of that one input.

Example 2

A Real Word
Input
all ones and "ASICPOIN"
Output
crc_out = 0x6eace35a

The first word of a frame starts from all ones.

Example 3

Register Only
Input
crc_in = 80000000h, data = 0
Output
crc_out = 0x79005533

The register's own share: what 64 steps do to its top bit.

Constraints and Contract

  • Keep the module name and the ports. The design is purely combinational.
  • The tests change the inputs and read crc_out 1 ns later.
  • Off limits: the names lib, model, want, rng, tb, root and the modules of the bench.

Hints

Hint 1

Is a byte-by-byte rewrite any shallower? Eight byte steps in a row are still 64 steps deep.

Hint 2

The update is linear over XOR. Write each output bit as the XOR of a fixed set of the 96 input bits.

Hint 3

You need not type the sets by hand. A constant function can push one input bit at a time through the 64 steps at elaboration time.

What the grader checks: Four fixed words are compared with an independent JavaScript model. 400 random words and 30 frames are compared with the bench library's CRC register. The budget is measured by the synthesis flow on the design alone: a proxy from an open-source tool, not a timing result.

The submitted design must synthesize with 0 latches and no combinational loop. It must use at most 9 logic levels; a result equal to the limit passes. Counts come from the pinned open-source synthesis flow. They are proxies for logic size and depth, not physical area or timing.

6 checks on Icarus Verilog + Yosys · server. Run the examples first, then check the full regression. Full checks use the server judge. Downloads contain your source only; samples require the simulation service. A passing result establishes the tested cases, not a proof for all possible inputs.

See all 2 steps and the final capstone

Report a problem with this page

Your code SystemVerilogSaved locally
Ln 1, Col 1Tab indents · Ctrl/⌘ + Enter runs samples
Not run yet

One Data Bit

Input
crc_in = 0, data = 1
Expected output
crc_out = 0x79005533

Only bit 0 of octet 0 is set. The result is the column of that one input.

Run samples executes all 3 public checks. Check all tests runs 6 checks on the server.

Icarus Verilog + Yosys · server