experiments/primitive_ram: customize the clock/reset of one of the RAM ports

This commit is contained in:
David Anderson 2024-08-13 20:53:47 -07:00
parent a23661a449
commit a69cc878ce
1 changed files with 12 additions and 6 deletions

View File

@ -2,13 +2,19 @@ package Top;
import ECP5_RAM::*; import ECP5_RAM::*;
(* synthesize *) (* always_enabled *)
module mkTop(ECP5_EBRCorePort#(Bit#(12), Bit#(8))); interface Top;
let clk <- exposeCurrentClock; method Action put(UInt#(3) select, Bool write, Bit#(12) address, Bit#(4) data);
let rstN <- exposeCurrentReset; method Bit#(4) read();
endinterface
ECP5_EBRPortConfig cfg = defaultValue; (* synthesize *)
ECP5_EBRCore#(Bit#(12), Bit#(8), UInt#(12), UInt#(8)) ram <- mkECP5_EBRCoreByte(cfg, cfg); module mkTop(Clock extClk, Reset extRst, Top ifc);
ECP5_EBRPortConfig cfgA = defaultValue;
cfgA.clk = tagged Valid extClk;
cfgA.rstN = tagged Valid extRst;
ECP5_EBRPortConfig cfgB = defaultValue;
ECP5_EBRCore#(Bit#(12), Bit#(4), UInt#(12), UInt#(4)) ram <- mkECP5_EBRCore(cfgA, cfgB);
method put = ram.portA.put; method put = ram.portA.put;
method read = ram.portA.read; method read = ram.portA.read;