diff --git a/experiments/vram/Top.bsv b/experiments/vram/Top.bsv index 94c5324..e38a64f 100644 --- a/experiments/vram/Top.bsv +++ b/experiments/vram/Top.bsv @@ -1,12 +1,12 @@ package Top; -import VRAM::*; +import VRAMCore::*; import ECP5_RAM::*; import TriState::*; (* synthesize *) -module mkTop(VRAM); - let _ret <- mkVRAM(112); +module mkTop(VRAMCore); + let _ret <- mkVRAMCore(112); return _ret; endmodule diff --git a/vram/VRAM.bsv b/vram/VRAMCore.bsv similarity index 92% rename from vram/VRAM.bsv rename to vram/VRAMCore.bsv index f70abb2..ca80e6f 100644 --- a/vram/VRAM.bsv +++ b/vram/VRAMCore.bsv @@ -1,5 +1,6 @@ -package VRAM; +package VRAMCore; +import Connectable::*; import GetPut::*; import ClientServer::*; import DReg::*; @@ -15,11 +16,12 @@ import ECP5_RAM::*; export VRAMAddr; export VRAMData; -export mkVRAM; export VRAMRequest; export VRAMResponse; +export VRAMClient; export VRAMServer; -export VRAM; +export VRAMCore; +export mkVRAMCore; typedef Bit#(8) VRAMData; @@ -133,30 +135,30 @@ typedef struct { typedef Server#(VRAMRequest, VRAMResponse) VRAMServer; typedef Client#(VRAMRequest, VRAMResponse) VRAMClient; -interface VRAM; +interface VRAMCore; interface VRAMServer portA; interface VRAMServer portB; endinterface -// mkVRAM creates a dual port VRAM of the specified size, using ECP5 -// EBR memory primitives. The memory size must be a multiple of 4KiB, -// with a maximum of 128KiB. +// mkVRAMCore creates a dual port VRAM of the specified size, using +// ECP5 EBR memory primitives. The memory size must be a multiple of +// 4KiB, with a maximum of 128KiB. // -// The returned VRAM servers implement flow control. As long as +// The returned VRAMCore servers implement flow control. As long as // responses are processed as soon as they're available, each port can // process one memory operation per cycle. // -// The VRAM does not prevent write-write or write-read conflicts +// The VRAMCore does not prevent write-write or write-read conflicts // between the ports. The outcome of a simultaneous write to the same // address is unspecified, as is the read output in a simultaneous // read and write of the same address. The caller must use external // arbitration to avoid such accesses. -module mkVRAM(Integer num_kilobytes, VRAM ifc); +module mkVRAMCore(Integer num_kilobytes, VRAMCore ifc); if (num_kilobytes > 128) - error("maximum VRAM size is 128KiB"); + error("maximum VRAMCore size is 128KiB"); let num_bytes = num_kilobytes*1024; if (num_bytes % 4096 != 0) - error("VRAM must be a multiple of 4096b"); + error("VRAMCore must be a multiple of 4096b"); let num_byterams = num_bytes/4096; let num_arrays = ceil(fromInteger(num_byterams) / 8);