Asynchronous FIFO pin model: scoped style exception

Русский

Synthesizable RTL uses always_ff, always_comb and assign. The only exception is models/cd74hc40105.sv in the two FIFO lessons: this is a simulation-only model. It uses always @ (SI or SO or RESET) to detect independent write/read edges and update one queue model in one process.

Two always_ff processes cannot legally drive the same queue occupancy state. always_comb reschedules on changes to all read variables and does not express the event contract of two independent control pins. Therefore this model is not a synthesis target; FPGA/ASIC examples use generic RTL with a validity vector and no occupancy counter.

Sampling CARRY_RESET on the falling clock edge in the 4032 model and checking FIFO results after the falling edge are necessary for those chips and fit the rule’s “unless you have to” exception. Time declarations appear only in testbenches: `timescale 1ns / 1ps. Four-space indentation, alignment, plain net ports and wire only for continuous declaration assignments remain in force.

Style rules · FIFO 4×16 · Three FIFOs