From 396cd1e80a5ff5545dbdc668119487bce0c85114 Mon Sep 17 00:00:00 2001 From: Vitor Bandeira Date: Mon, 19 Oct 2026 04:36:11 -0300 Subject: [PATCH] chore(designs): remove asap7/mock-cpu and src/fifo asap7/chi_async_bridge replaces asap7/mock-cpu. CI no longer builds mock-cpu. No other design reads designs/src/fifo. Update the chi_async_bridge README, which named mock-cpu as the only other design with a timed asynchronous crossing. Signed-off-by: Vitor Bandeira --- flow/designs/asap7/chi_async_bridge/README.md | 4 +- flow/designs/asap7/mock-cpu/config.mk | 33 ------ flow/designs/asap7/mock-cpu/constraint.sdc | 107 ------------------ flow/designs/asap7/mock-cpu/io.tcl | 4 - flow/designs/src/fifo/.gitignore | 2 - flow/designs/src/fifo/LICENSE | 3 - flow/designs/src/fifo/fifo.v | 25 ---- flow/designs/src/fifo/fifo1.v | 65 ----------- flow/designs/src/fifo/fifomem.v | 32 ------ flow/designs/src/fifo/mock_cpu.v | 71 ------------ flow/designs/src/fifo/mock_cpu_tb.v | 78 ------------- flow/designs/src/fifo/rptr_empty.v | 31 ----- flow/designs/src/fifo/sync_r2w.v | 13 --- flow/designs/src/fifo/sync_w2r.v | 13 --- flow/designs/src/fifo/wptr_full.v | 32 ------ 15 files changed, 2 insertions(+), 511 deletions(-) delete mode 100644 flow/designs/asap7/mock-cpu/config.mk delete mode 100644 flow/designs/asap7/mock-cpu/constraint.sdc delete mode 100644 flow/designs/asap7/mock-cpu/io.tcl delete mode 100644 flow/designs/src/fifo/.gitignore delete mode 100644 flow/designs/src/fifo/LICENSE delete mode 100644 flow/designs/src/fifo/fifo.v delete mode 100644 flow/designs/src/fifo/fifo1.v delete mode 100644 flow/designs/src/fifo/fifomem.v delete mode 100644 flow/designs/src/fifo/mock_cpu.v delete mode 100644 flow/designs/src/fifo/mock_cpu_tb.v delete mode 100644 flow/designs/src/fifo/rptr_empty.v delete mode 100644 flow/designs/src/fifo/sync_r2w.v delete mode 100644 flow/designs/src/fifo/sync_w2r.v delete mode 100644 flow/designs/src/fifo/wptr_full.v diff --git a/flow/designs/asap7/chi_async_bridge/README.md b/flow/designs/asap7/chi_async_bridge/README.md index af19367d79..a324663b5a 100644 --- a/flow/designs/asap7/chi_async_bridge/README.md +++ b/flow/designs/asap7/chi_async_bridge/README.md @@ -21,9 +21,9 @@ with some of them at all: | feature | where | elsewhere in `flow/designs` | |---|---|---| -| an asynchronous crossing that is timed: `set_clock_groups -asynchronous -allow_paths`, bounded by `set_max_delay -ignore_clock_latency` between the clocks, no hold check across | `constraint.sdc` | only `asap7/mock-cpu`; the other multi-clock designs declare their clocks exclusive or time only virtual IO clocks | +| an asynchronous crossing that is timed: `set_clock_groups -asynchronous -allow_paths`, bounded by `set_max_delay -ignore_clock_latency` between the clocks, no hold check across | `constraint.sdc` | none; the other multi-clock designs declare their clocks exclusive or time only virtual IO clocks | | a constraint file that checks the netlist it names and stops the flow if synthesis renamed, merged or restructured what it constrains | `constraint.sdc`, the synchronisers | none | -| the slang frontend, the hierarchy kept by name with `SYNTH_KEEP_MODULES` on slang's uniquified, parameterised modules, and linked with `OPENROAD_HIERARCHICAL` (`-hier`) | `config.mk` | none together; `asap7/mock-cpu` keeps its hierarchy with an RTL attribute and reads its Verilog with yosys | +| the slang frontend, the hierarchy kept by name with `SYNTH_KEEP_MODULES` on slang's uniquified, parameterised modules, and linked with `OPENROAD_HIERARCHICAL` (`-hier`) | `config.mk` | none | | instance names in the constraints resolved through that hierarchy (`get_cells -hierarchical`) and written back by hierarchical name for every later stage | `constraint.sdc` | none | | three threshold voltages, RVT, LVT and SLVT, on a multi-clock design | `ASAP7_USE_VT` | `asap7/cva6`, single-clock; the `_lvt` designs use LVT alone | | the top's parameters set from the flow, one RTL for every variant | `VERILOG_TOP_PARAMS` | `asap7/uart` | diff --git a/flow/designs/asap7/mock-cpu/config.mk b/flow/designs/asap7/mock-cpu/config.mk deleted file mode 100644 index 92b55b75d0..0000000000 --- a/flow/designs/asap7/mock-cpu/config.mk +++ /dev/null @@ -1,33 +0,0 @@ -export PLATFORM = asap7 - -export DESIGN_NAME = mock_cpu -export DESIGN_NICKNAME = mock-cpu - -export VERILOG_FILES = $(wildcard $(DESIGN_HOME)/src/fifo/*.v) -export SDC_FILE = $(DESIGN_HOME)/$(PLATFORM)/$(DESIGN_NICKNAME)/constraint.sdc -export SDC_FILE_EXTRA = $(DESIGN_HOME)/src/mock-array/util.tcl - -# The SDC references fifo_in/ and fifo_out/ directly. Two -# knobs must agree to make those pin paths resolve in OpenSTA: -# -# 1. Yosys must keep the fifo1 module boundary through flattening. -# SYNTH_KEEP_MODULES doesn't work here because hierarchy elaboration -# specializes fifo1 into $paramod$\fifo1 before the flow's -# keep loop runs — instead we use an (* keep_hierarchy *) RTL -# attribute on the module itself (see src/fifo/fifo1.v). -# -# 2. OpenROAD must link the netlist hierarchically, otherwise -# link_design flattens the fifo_in / fifo_out instances even though -# Yosys preserved them. OPENROAD_HIERARCHICAL=1 switches link_design -# to -hier mode. (Same mechanism used by asap7/mock-alu, cva6, -# swerv_wrapper.) -export OPENROAD_HIERARCHICAL = 1 - -export CORE_UTILIZATION = 40 -export CORE_ASPECT_RATIO = 1 -export CORE_MARGIN = 2 -export PLACE_DENSITY = 0.71 -export TNS_END_PERCENT = 100 - -export IO_CONSTRAINTS = designs/asap7/mock-cpu/io.tcl - diff --git a/flow/designs/asap7/mock-cpu/constraint.sdc b/flow/designs/asap7/mock-cpu/constraint.sdc deleted file mode 100644 index 72d8abaa6b..0000000000 --- a/flow/designs/asap7/mock-cpu/constraint.sdc +++ /dev/null @@ -1,107 +0,0 @@ -# mock-cpu: multi-clock async-FIFO bridge macro. -# -# PR #4170 idiom (multi-clock variant): optimization targets use -# set_max_delay -ignore_clock_latency so hold-fixing does not invent -# phantom budgets against the deep clock tree's insertion delay. See -# flow/platforms/asap7/constraints.sdc lines 1-56 for the single-clock -# rationale; this file can't `source` that template because mock-cpu -# has two async clocks. -# -# The IO optimization targets below are deliberately surgical: -# set_max_delay from top-level ports to fifo_in/ and from -# fifo_out/ to top-level ports, rather than -to [all_registers] / -# -from [all_registers]. Functionally equivalent for this topology -# (all IO paths begin/end at the FIFO), but it exercises more flow -# features — SYNTH_KEEP_MODULES hierarchy preservation, hierarchical -# get_pins selection, and io2fifo/fifo2io path grouping. Intentional -# regression coverage; do not "simplify" back to [all_registers]. -# -# (* keep_hierarchy *) on the fifo1 module (src/fifo/fifo1.v) preserves -# the FIFO instance boundary through Yosys flattening so the fifo_in/ -# and fifo_out/ paths below resolve. An RTL attribute is used rather -# than SYNTH_KEEP_MODULES because the latter matches exact module names -# and hierarchy elaboration specializes fifo1 into $paramod$\fifo1 -# before SYNTH_KEEP_MODULES runs. -# -# FIFO RTL: Cummings SNUG 2002 — gray-coded pointers, 2-FF synchronizers -# (sync_r2w, sync_w2r). Metastability handled by construction. -# https://gist.github.com/brabect1/7695ead3d79be47576890bbcd61fe426 - -source $::env(SDC_FILE_EXTRA) - -set sdc_version 2.0 - -set clk_period 270 -set clk2_period 810 - -set clk1_name clk -create_clock -name $clk1_name -period $clk_period \ - -waveform [list 0 [expr $clk_period/2]] [get_ports $clk1_name] -set_clock_uncertainty 10 [get_clocks $clk1_name] - -set clk2_name clk_uncore -create_clock -name $clk2_name -period $clk2_period \ - -waveform [list 0 [expr $clk2_period/2]] [get_ports $clk2_name] -set_clock_uncertainty 10 [get_clocks $clk2_name] - -set_clock_groups -group $clk1_name -group $clk2_name -asynchronous -allow_paths - -# Async reset distribution. -set_false_path -from [get_ports *rst_n] -set_false_path -to [get_ports *rst_n] - -# Timing firewall: surgical port <-> FIFO boundary optimization targets. -# Internal 1024-stage pipeline is reg2reg, constrained by the clock -# period alone. IO paths end/begin at the FIFO boundary — no further. -set io_target 80 - -set fifo_in_wdata [get_pins fifo_in/wdata[*]] -set fifo_in_winc [get_pins fifo_in/winc] -set fifo_out_rinc [get_pins fifo_out/rinc] - -# Port -> FIFO. -to on a hierarchical instance input pin is accepted: -# OpenSTA traverses into the instance and finds the leaf endpoint. -set_max_delay -ignore_clock_latency $io_target \ - -from [get_ports wdata*] -to $fifo_in_wdata -set_max_delay -ignore_clock_latency $io_target \ - -from [get_ports winc] -to $fifo_in_winc -set_max_delay -ignore_clock_latency $io_target \ - -from [get_ports rinc] -to $fifo_out_rinc - -# FIFO -> Port. The symmetric surgical form -from $fifo_out_ -# hits STA-1554 ("not a valid start point") because a hierarchical -# instance output pin has no implicit launch clock. Use -# [all_registers] instead — OPENROAD_HIERARCHICAL=1 plus the fifo1 -# keep_hierarchy makes [all_registers] enumerate leaf flops inside -# fifo_out (fifomem and pointer-sync flops) whose Q pins are valid -# start points, matching the platform template's single-clock form. -# rdata is excluded here; it's false_path'd at the bottom. -set_max_delay -ignore_clock_latency $io_target \ - -from [all_registers] -to [get_ports rempty] -set_max_delay -ignore_clock_latency $io_target \ - -from [all_registers] -to [get_ports wfull] - -group_path -name io2fifo \ - -from [all_inputs -no_clocks] \ - -to [list $fifo_in_wdata $fifo_in_winc $fifo_out_rinc] -group_path -name reg2out -from [all_registers] -to [all_outputs] -group_path -name reg2reg -from [all_registers] -to [all_registers] - -# Dual-clock FIFO CDC: bound combinational delay on pointer-sync paths -# (sync_r2w, sync_w2r) to the fastest clock period, ignore clock -# latency (deep tree), and declare hold false — gray-coded pointers -# and 2-FF synchronizers handle metastability by construction. -set cdc_max_delay $clk_period -set_max_delay $cdc_max_delay -from $clk1_name -to $clk2_name -ignore_clock_latency -set_max_delay $cdc_max_delay -from $clk2_name -to $clk1_name -ignore_clock_latency -set_false_path -hold -from $clk1_name -to $clk2_name -set_false_path -hold -from $clk2_name -to $clk1_name - -# rdata port has no launch FF on the IO side. It's driven -# combinationally by fifo_out.fifomem (mem[raddr]): -# clk-clocked fifomem flops -> rdata (wclk launch path) -# clk_uncore-clocked rbin -> raddr -> mem mux -> rdata (rclk launch) -# Both are "valid when rempty is low" by FIFO protocol, not a -# single-cycle timing. Declare every path to rdata as false — normal -# FIFO deployments would put an FF on rdata in the consumer domain. -set_false_path -to [get_ports rdata*] diff --git a/flow/designs/asap7/mock-cpu/io.tcl b/flow/designs/asap7/mock-cpu/io.tcl deleted file mode 100644 index 5591aab16a..0000000000 --- a/flow/designs/asap7/mock-cpu/io.tcl +++ /dev/null @@ -1,4 +0,0 @@ -source $::env(SDC_FILE_EXTRA) - -set_io_pin_constraint -order -group -region bottom:* \ - -pin_names [concat [match_pins .*] [match_pins clk input 1]] diff --git a/flow/designs/src/fifo/.gitignore b/flow/designs/src/fifo/.gitignore deleted file mode 100644 index 8c86792c0b..0000000000 --- a/flow/designs/src/fifo/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*.vcd -*.vvp diff --git a/flow/designs/src/fifo/LICENSE b/flow/designs/src/fifo/LICENSE deleted file mode 100644 index 30babd2b9f..0000000000 --- a/flow/designs/src/fifo/LICENSE +++ /dev/null @@ -1,3 +0,0 @@ -From http://www.sunburst-design.com/papers/CummingsSNUG2002SJ_FIFO1.pdf. - -No license or warranty is described in the paper. diff --git a/flow/designs/src/fifo/fifo.v b/flow/designs/src/fifo/fifo.v deleted file mode 100644 index 1c5c7a52ae..0000000000 --- a/flow/designs/src/fifo/fifo.v +++ /dev/null @@ -1,25 +0,0 @@ -module fifo ( - output [31:0] rdata, - output wfull, - output rempty, - input [31:0] wdata, - input winc, wclk, wrst_n, - input rinc, rclk, rrst_n -); - - fifo1 #( - .DSIZE(32), - .ASIZE(5) - ) fifo_instance ( - .rdata(rdata), - .wfull(wfull), - .rempty(rempty), - .wdata(wdata), - .winc(winc), - .wclk(wclk), - .wrst_n(wrst_n), - .rinc(rinc), - .rclk(rclk), - .rrst_n(rrst_n) - ); -endmodule diff --git a/flow/designs/src/fifo/fifo1.v b/flow/designs/src/fifo/fifo1.v deleted file mode 100644 index 686359dfef..0000000000 --- a/flow/designs/src/fifo/fifo1.v +++ /dev/null @@ -1,65 +0,0 @@ -// (* keep_hierarchy *) preserves the fifo1 instance boundary (fifo_in, -// fifo_out in mock_cpu) through Yosys flattening so the SDC can -// reference fifo_in/ and fifo_out/ directly. SYNTH_KEEP_MODULES -// doesn't work here because hierarchy elaboration specializes fifo1 into -// $paramod$\fifo1 variants before the flow's SYNTH_KEEP_MODULES -// loop runs. An RTL attribute rides through elaboration onto each -// specialized clone. -(* keep_hierarchy *) -module fifo1 #( - parameter DSIZE = 8, - parameter ASIZE = 4 -) ( - output [DSIZE-1:0] rdata, - output wfull, - output rempty, - input [DSIZE-1:0] wdata, - input winc, - wclk, - wrst_n, - input rinc, - rclk, - rrst_n -); - wire [ASIZE-1:0] waddr, raddr; - wire [ASIZE:0] wptr, rptr, wq2_rptr, rq2_wptr; - sync_r2w #(ASIZE) sync_r2w ( - .wq2_rptr(wq2_rptr), - .rptr(rptr), - .wclk(wclk), - .wrst_n(wrst_n) - ); - sync_w2r #(ASIZE) sync_w2r ( - .rq2_wptr(rq2_wptr), - .wptr(wptr), - .rclk(rclk), - .rrst_n(rrst_n) - ); - fifomem #(DSIZE, ASIZE) fifomem ( - .rdata (rdata), - .wdata (wdata), - .waddr (waddr), - .raddr (raddr), - .wclken(winc), - .wfull (wfull), - .wclk (wclk) - ); - rptr_empty #(ASIZE) rptr_empty ( - .rempty(rempty), - .raddr(raddr), - .rptr(rptr), - .rq2_wptr(rq2_wptr), - .rinc(rinc), - .rclk(rclk), - .rrst_n(rrst_n) - ); - wptr_full #(ASIZE) wptr_full ( - .wfull(wfull), - .waddr(waddr), - .wptr(wptr), - .wq2_rptr(wq2_rptr), - .winc(winc), - .wclk(wclk), - .wrst_n(wrst_n) - ); -endmodule diff --git a/flow/designs/src/fifo/fifomem.v b/flow/designs/src/fifo/fifomem.v deleted file mode 100644 index 1dd6a172c3..0000000000 --- a/flow/designs/src/fifo/fifomem.v +++ /dev/null @@ -1,32 +0,0 @@ -module fifomem #( - parameter DATASIZE = 8, // Memory data word width - parameter ADDRSIZE = 4 -) // Number of mem address bits -( - output [DATASIZE-1:0] rdata, - input [DATASIZE-1:0] wdata, - input [ADDRSIZE-1:0] waddr, - raddr, - input wclken, - wfull, - wclk -); -`ifdef VENDORRAM - // instantiation of a vendor's dual-port RAM - vendor_ram mem ( - .dout(rdata), - .din(wdata), - .waddr(waddr), - .raddr(raddr), - .wclken(wclken), - .wclken_n(wfull), - .clk(wclk) - ); -`else - // RTL Verilog memory model - localparam DEPTH = 1 << ADDRSIZE; - reg [DATASIZE-1:0] mem[0:DEPTH-1]; - assign rdata = mem[raddr]; - always @(posedge wclk) if (wclken && !wfull) mem[waddr] <= wdata; -`endif -endmodule diff --git a/flow/designs/src/fifo/mock_cpu.v b/flow/designs/src/fifo/mock_cpu.v deleted file mode 100644 index f04d913b43..0000000000 --- a/flow/designs/src/fifo/mock_cpu.v +++ /dev/null @@ -1,71 +0,0 @@ -// a mock CPU. The inputs and outputs are disconnected from the -// outside world via FIFOs to deal with a large clock insertion -// latency of the CPU core. -// -// One input FIFO and one output FIFO are used. The input FIFOs -// upper and lower bits are multiplied with 4 pipeline stages -// and output on the output FIFO. -// -// ASIZE 3 and DSIZE 32 are used for the FIFOs. -module mock_cpu ( - output [31:0] rdata, - output wfull, - output rempty, - input [31:0] wdata, - input winc, wrst_n, - input rinc, clk, clk_uncore, rrst_n -); - parameter STAGES = 1024; - - reg [31:0] mult_result [0:STAGES - 1]; - reg winc_out [0:STAGES - 1]; - - wire [31:0] wdata_out; - wire [31:0] rdata_in; - wire rinc_in, rempty_in; - wire wfull_out; - - fifo1 #(.ASIZE(1), .DSIZE(32)) fifo_in ( - .wdata(wdata), - .winc(winc), - .wfull(wfull), - .rclk(clk), - .wclk(clk_uncore), - .wrst_n(wrst_n), - .rrst_n(rrst_n), - .rdata(rdata_in), - .rinc(rinc_in), - .rempty(rempty_in) - ); - - fifo1 #(.ASIZE(3), .DSIZE(32)) fifo_out ( - .wdata(mult_result[STAGES - 1]), - .winc(winc_out[STAGES - 1]), - .wfull(wfull_out), - .rclk(clk_uncore), - .wclk(clk), - .wrst_n(wrst_n), - .rrst_n(rrst_n), - .rdata(rdata), - .rinc(rinc), - .rempty(rempty) - ); - - assign rinc_in = !rempty_in; - - generate - genvar i; - for (i = 0; i < STAGES; i=i+1) begin : mult_pipeline - always @(posedge clk) begin - if (i == 0) begin - mult_result[i] <= rdata_in[15:0] + rdata_in[31:16]; - winc_out[i] <= !rempty_in; - end else begin - mult_result[i] <= mult_result[i-1]; - winc_out[i] <= winc_out[i-1]; - end - end - end - endgenerate - -endmodule diff --git a/flow/designs/src/fifo/mock_cpu_tb.v b/flow/designs/src/fifo/mock_cpu_tb.v deleted file mode 100644 index 9b6be5f935..0000000000 --- a/flow/designs/src/fifo/mock_cpu_tb.v +++ /dev/null @@ -1,78 +0,0 @@ -// fifo_oneclock_tb.v -// To run: -// -// iverilog -o fifo_oneclock_tb.vvp *.v && vvp fifo_oneclock_tb.vvp -// gtkwave dump.vcd -`timescale 1ns/1ns - -module fifo_oneclock_tb; - integer start_time; - integer result; - wire [31:0] rdata; - wire wfull; - wire rempty; - reg [31:0] wdata; - reg winc; - reg wrst_n; - reg rinc; - reg clk; - reg rrst_n; - - // Instantiate the fifo_oneclock module - fifo_oneclock #(.STAGES(4)) u_fifo_oneclock ( - .rdata(rdata), - .wfull(wfull), - .rempty(rempty), - .wdata(wdata), - .winc(winc), - .wrst_n(wrst_n), - .rinc(rinc), - .clk(clk), - .clk_uncore(clk), - .rrst_n(rrst_n) - ); - - initial begin - $dumpfile("dump.vcd"); - $dumpvars(0, fifo_oneclock_tb); - - // Initialize signals - clk = 0; - wrst_n = 0; - rrst_n = 0; - winc = 0; - wdata = 0; - rinc = 0; - #21 - - // Apply stimulus - wrst_n = 1; - rrst_n = 1; - #2 winc = 1; - // assign 35 in hex syntax - wdata = 32'h00050007; - #2 winc = 0; - // wait until rempty is false - start_time = $time; - // Wait until rempty is false or 100 ticks have passed - while (rempty && $time < start_time + 100) begin - #2; - end - if (rempty) begin - $display("Timeout: rempty did not become false within 100 ticks"); - end - rinc = 1; - result = 12; - if (rdata === result) begin - $display("Test passed: rdata is %d", result); - end else begin - $display("Test failed: rdata is not %d, it is %d", result, rdata); - end - #2 rinc = 0; - - // End the simulation - #20 $finish; - end - - always #1 clk = ~clk; -endmodule diff --git a/flow/designs/src/fifo/rptr_empty.v b/flow/designs/src/fifo/rptr_empty.v deleted file mode 100644 index 528e511b70..0000000000 --- a/flow/designs/src/fifo/rptr_empty.v +++ /dev/null @@ -1,31 +0,0 @@ -module rptr_empty #( - parameter ADDRSIZE = 4 -) ( - output reg rempty, - output [ADDRSIZE-1:0] raddr, - output reg [ADDRSIZE : 0] rptr, - input [ADDRSIZE : 0] rq2_wptr, - input rinc, - rclk, - rrst_n -); - reg [ADDRSIZE:0] rbin; - wire [ADDRSIZE:0] rgraynext, rbinnext; - //------------------- - // GRAYSTYLE2 pointer - //------------------- - always @(posedge rclk or negedge rrst_n) - if (!rrst_n) {rbin, rptr} <= 0; - else {rbin, rptr} <= {rbinnext, rgraynext}; - // Memory read-address pointer (okay to use binary to address memory) - assign raddr = rbin[ADDRSIZE-1:0]; - assign rbinnext = rbin + (rinc & ~rempty); - assign rgraynext = (rbinnext >> 1) ^ rbinnext; - //--------------------------------------------------------------- - // FIFO empty when the next rptr == synchronized wptr or on reset - //--------------------------------------------------------------- - assign rempty_val = (rgraynext == rq2_wptr); - always @(posedge rclk or negedge rrst_n) - if (!rrst_n) rempty <= 1'b1; - else rempty <= rempty_val; -endmodule diff --git a/flow/designs/src/fifo/sync_r2w.v b/flow/designs/src/fifo/sync_r2w.v deleted file mode 100644 index 996c400ddb..0000000000 --- a/flow/designs/src/fifo/sync_r2w.v +++ /dev/null @@ -1,13 +0,0 @@ -module sync_r2w #( - parameter ADDRSIZE = 4 -) ( - output reg [ADDRSIZE:0] wq2_rptr, - input [ADDRSIZE:0] rptr, - input wclk, - wrst_n -); - reg [ADDRSIZE:0] wq1_rptr; - always @(posedge wclk or negedge wrst_n) - if (!wrst_n) {wq2_rptr, wq1_rptr} <= 0; - else {wq2_rptr, wq1_rptr} <= {wq1_rptr, rptr}; -endmodule diff --git a/flow/designs/src/fifo/sync_w2r.v b/flow/designs/src/fifo/sync_w2r.v deleted file mode 100644 index e51cadd20b..0000000000 --- a/flow/designs/src/fifo/sync_w2r.v +++ /dev/null @@ -1,13 +0,0 @@ -module sync_w2r #( - parameter ADDRSIZE = 4 -) ( - output reg [ADDRSIZE:0] rq2_wptr, - input [ADDRSIZE:0] wptr, - input rclk, - rrst_n -); - reg [ADDRSIZE:0] rq1_wptr; - always @(posedge rclk or negedge rrst_n) - if (!rrst_n) {rq2_wptr, rq1_wptr} <= 0; - else {rq2_wptr, rq1_wptr} <= {rq1_wptr, wptr}; -endmodule diff --git a/flow/designs/src/fifo/wptr_full.v b/flow/designs/src/fifo/wptr_full.v deleted file mode 100644 index 7886656c58..0000000000 --- a/flow/designs/src/fifo/wptr_full.v +++ /dev/null @@ -1,32 +0,0 @@ -module wptr_full #( - parameter ADDRSIZE = 4 -) ( - output reg wfull, - output [ADDRSIZE - 1:0] waddr, - output reg [ADDRSIZE : 0] wptr, - input [ADDRSIZE : 0] wq2_rptr, - input winc, - wclk, - wrst_n -); - reg [ADDRSIZE:0] wbin; - wire [ADDRSIZE:0] wgraynext, wbinnext; - // GRAYSTYLE2 pointer - always @(posedge wclk or negedge wrst_n) - if (!wrst_n) {wbin, wptr} <= 0; - else {wbin, wptr} <= {wbinnext, wgraynext}; - // Memory write-address pointer (okay to use binary to address memory) - assign waddr = wbin[ADDRSIZE-1:0]; - assign wbinnext = wbin + (winc & ~wfull); - assign wgraynext = (wbinnext >> 1) ^ wbinnext; - //------------------------------------------------------------------ - // Simplified version of the three necessary full-tests: - // assign wfull_val=((wgnext[ADDRSIZE] !=wq2_rptr[ADDRSIZE] ) && - // (wgnext[ADDRSIZE-1] !=wq2_rptr[ADDRSIZE-1]) && - // (wgnext[ADDRSIZE-2:0]==wq2_rptr[ADDRSIZE-2:0])); - //------------------------------------------------------------------ - assign wfull_val = (wgraynext == {~wq2_rptr[ADDRSIZE:ADDRSIZE-1], wq2_rptr[ADDRSIZE-2:0]}); - always @(posedge wclk or negedge wrst_n) - if (!wrst_n) wfull <= 1'b0; - else wfull <= wfull_val; -endmodule