OpenASIP 2.2
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
ProGe::SinglePortSSRAMBlock Class Reference

#include <SinglePortSSRAMBlock.hh>

Inheritance diagram for ProGe::SinglePortSSRAMBlock:
Inheritance graph
Collaboration diagram for ProGe::SinglePortSSRAMBlock:
Collaboration graph

Public Member Functions

 SinglePortSSRAMBlock ()=delete
 
 SinglePortSSRAMBlock (const std::string &addressWidth, const std::string &dataWidth, const std::string &initFile, bool isForSimulation=true)
 
virtual ~SinglePortSSRAMBlock ()
 
void setAccessTraceFile (const std::string filename)
 
const NetlistPortGroup & memoryPort () const
 
virtual void write (const Path &targetBaseDir, HDL targetLang=VHDL) const override
 
- Public Member Functions inherited from ProGe::BaseNetlistBlock
 BaseNetlistBlock ()
 
 BaseNetlistBlock (BaseNetlistBlock *parent)
 
 BaseNetlistBlock (const std::string &moduleName, const std::string &instanceName, BaseNetlistBlock *parent=nullptr)
 
virtual ~BaseNetlistBlock ()
 
const std::string & instanceName () const
 
void setInstanceName (const std::string &name)
 
const std::string & moduleName () const
 
const std::string name () const
 
virtual size_t subBlockCount () const
 
virtual const BaseNetlistBlock & subBlock (size_t index) const
 
virtual bool hasSubBlock (const std::string &instanceName) const
 
virtual bool isSubBlock (const BaseNetlistBlock &block) const
 
virtual bool hasParameter (const std::string &name) const
 
virtual const Parameter & parameter (const std::string &name) const
 
virtual size_t parameterCount () const
 
virtual const Parameter & parameter (size_t index) const
 
virtual size_t portCount () const
 
virtual const NetlistPort & port (size_t index) const
 
virtual std::vector< const NetlistPort * > portsBy (SignalType type) const
 
virtual const NetlistPort & portBy (SignalType type, size_t index=0) const
 
virtual bool hasPortsBy (SignalType type) const
 
virtual const NetlistPort * port (const std::string &portName, bool partialMatch=true) const
 
virtual size_t portGroupCount () const
 
virtual const NetlistPortGroup & portGroup (size_t index) const
 
virtual std::vector< const NetlistPortGroup * > portGroupsBy (SignalGroupType type) const
 
virtual const Netlist & netlist () const
 
virtual bool hasParentBlock () const
 
virtual const BaseNetlistBlock & parentBlock () const
 
virtual bool isVirtual () const
 
virtual void build () override
 
virtual void connect () override
 
virtual void finalize () override
 
virtual void writeSelf (const Path &targetBaseDir, HDL targetLang=VHDL) const
 
virtual size_t packageCount () const
 
virtual const std::string & package (size_t idx) const
 
PortContainerType & ports ()
 
virtual bool isLeaf () const
 
BaseNetlistBlock * shallowCopy (const std::string &instanceName="") const
 
- Public Member Functions inherited from ProGe::IGenerationPhases
virtual ~IGenerationPhases ()
 

Private Attributes

NetlistPortGroup * memoryPortGroup_ = nullptr
 
bool isForSimulation_ = true
 

Additional Inherited Members

- Public Types inherited from ProGe::BaseNetlistBlock
typedef std::vector< BaseNetlistBlock * > BlockContainerType
 
typedef std::vector< Parameter > ParameterContainerType
 
typedef std::vector< NetlistPort * > PortContainerType
 
typedef std::vector< NetlistPortGroup * > PortGroupContainerType
 
- Protected Member Functions inherited from ProGe::BaseNetlistBlock
Netlist & netlist ()
 
virtual NetlistPort & port (size_t index)
 
virtual BaseNetlistBlock & subBlock (size_t index)
 
virtual BaseNetlistBlock & parentBlock ()
 
void setModuleName (const std::string &name)
 
void addSubBlock (BaseNetlistBlock *subBlock, const std::string &instanceName="")
 
void deleteSubBlock (BaseNetlistBlock *subBlock)
 
void removeSubBlock (BaseNetlistBlock *subBlock)
 
NetlistPort * addPort (NetlistPort *port)
 
void removePort (NetlistPort *port)
 
void addPortGroup (NetlistPortGroup *portGroup)
 
void removePortGroup (NetlistPortGroup *portGroup)
 
void setParameter (const Parameter &param)
 
void addParameter (const Parameter &param)
 
Parameter & parameter (const std::string &name)
 
NetlistPort * findPort (const std::string &portName, bool recursiveSearch=false, bool partialMatch=true) const
 
void addPackage (const std::string &packageName)
 
void connectClocks ()
 
void connectResets ()
 

Detailed Description

Definition at line 46 of file SinglePortSSRAMBlock.hh.

Constructor & Destructor Documentation

◆ SinglePortSSRAMBlock() [1/2]

ProGe::SinglePortSSRAMBlock::SinglePortSSRAMBlock ( )
delete

References write().

Here is the call graph for this function:

◆ SinglePortSSRAMBlock() [2/2]

ProGe::SinglePortSSRAMBlock::SinglePortSSRAMBlock ( const std::string &  addressWidth,
const std::string &  dataWidth,
const std::string &  memInitFile,
bool  isForSimulation = true 
)

Constructs Single port synchronous SRAM block.

Parameters
addressWidthThe width of the address port.
dataWidthThe width of the data port.
memInitFileName of the memory initialization file loaded during RTL-simulation.
isForSimulationTells if the block is used in RTL simulation. Affects placement of the HDL source.

Definition at line 56 of file SinglePortSSRAMBlock.cc.

59 : BaseNetlistBlock("synch_sram", ""), isForSimulation_(isForSimulation) {
60 addParameter(Parameter("DATAW", "integer", dataWidth));
61 addParameter(Parameter("ADDRW", "integer", addressWidth));
62 addParameter(Parameter("INITFILENAME", "string", memInitFile));
63 addParameter(Parameter("access_trace", "boolean", "false"));
65 Parameter("ACCESSTRACEFILENAME", "string", "\"access_trace\""));
66
68
69 // todo add memory ports via PortFactory
73 new InPort("d", "DATAW", BIT_VECTOR, SignalType::WRITE_DATA),
74 new InPort("addr", "ADDRW", BIT_VECTOR, SignalType::ADDRESS),
75 new InBitPort(
76 "en_x",
78 new InBitPort(
80 new InPort(
81 "bit_wr_x", "DATAW", BIT_VECTOR, SignalType::WRITE_BITMASK),
82 new OutPort("q", "DATAW", BIT_VECTOR, SignalType::READ_DATA)));
83}
NetlistPort * addPort(NetlistPort *port)
void addParameter(const Parameter &param)
void addPortGroup(NetlistPortGroup *portGroup)
static NetlistPort * clockPort(Direction direction=IN)
@ BIT_VECTOR
Several bits.
Definition ProGeTypes.hh:48
@ BITMASKED_SRAM_PORT
Signal group type for one port SRAM having read and write capability and bitmask for writing.
@ ADDRESS
Signal holds address.
@ READ_WRITE_REQUEST
Signal to make either read or write request.
@ WRITEMODE
Signal to choose mode for READ_WRITE_REQUEST or similar.

References ProGe::BaseNetlistBlock::addParameter(), ProGe::BaseNetlistBlock::addPort(), ProGe::BaseNetlistBlock::addPortGroup(), ProGe::ADDRESS, ProGe::BIT_VECTOR, ProGe::BITMASKED_SRAM_PORT, ProGe::PortFactory::clockPort(), ProGe::LOW, memoryPortGroup_, ProGe::BaseNetlistBlock::NetlistPortGroup, ProGe::BaseNetlistBlock::Parameter, ProGe::READ_DATA, ProGe::READ_WRITE_REQUEST, ProGe::WRITE_BITMASK, ProGe::WRITE_DATA, and ProGe::WRITEMODE.

Here is the call graph for this function:

◆ ~SinglePortSSRAMBlock()

ProGe::SinglePortSSRAMBlock::~SinglePortSSRAMBlock ( )
virtual

Definition at line 85 of file SinglePortSSRAMBlock.cc.

85{}

Member Function Documentation

◆ memoryPort()

const NetlistPortGroup & ProGe::SinglePortSSRAMBlock::memoryPort ( ) const

Definition at line 97 of file SinglePortSSRAMBlock.cc.

97 {
98 assert(memoryPortGroup_ != nullptr);
99 return *memoryPortGroup_;
100}
#define assert(condition)

References assert, and memoryPortGroup_.

Referenced by ProGe::ProcessorWrapperBlock::addDataMemory(), and ProGe::ProcessorWrapperBlock::addInstructionMemory().

◆ setAccessTraceFile()

void ProGe::SinglePortSSRAMBlock::setAccessTraceFile ( const std::string  filename)

Sets a file name where memory access trace is dumped for this memory.

Definition at line 91 of file SinglePortSSRAMBlock.cc.

91 {
92 this->setParameter(Parameter("access_trace", "boolean", "true"));
93 this->setParameter(Parameter("ACCESSTRACEFILENAME", "string", filename));
94}
void setParameter(const Parameter &param)

References ProGe::BaseNetlistBlock::Parameter, and ProGe::BaseNetlistBlock::setParameter().

Referenced by ProGe::ProcessorWrapperBlock::addInstructionMemory().

Here is the call graph for this function:

◆ write()

void ProGe::SinglePortSSRAMBlock::write ( const Path &  targetBaseDir,
HDL  targetLang = VHDL 
) const
overridevirtual

Does nothing on self but calls write function on each sub block.

Reimplemented from ProGe::BaseNetlistBlock.

Definition at line 103 of file SinglePortSSRAMBlock.cc.

103 {
104 Path progeDataDir(Environment::dataDirPath("ProGe"));
105
106 std::string tempFile = (targetLang == VHDL)
107 ? std::string("synch_sram.vhdl")
108 : std::string("synch_sram.v");
109 std::string targetDir =
110 (isForSimulation_) ? std::string("tb")
111 : ((targetLang == VHDL) ? std::string("vhdl")
112 : std::string("verilog"));
114 (progeDataDir / std::string("tb") / tempFile).string(),
115 (targetBaseDir / targetDir / tempFile).string());
116}
static std::string dataDirPath(const std::string &prog)
void instantiateTemplateFile(const std::string &templateFile, const std::string &dstFile)
@ VHDL
VHDL.
Definition ProGeTypes.hh:41

References Environment::dataDirPath(), HDLTemplateInstantiator::instantiateTemplateFile(), isForSimulation_, and ProGe::VHDL.

Referenced by SinglePortSSRAMBlock().

Here is the call graph for this function:

Member Data Documentation

◆ isForSimulation_

bool ProGe::SinglePortSSRAMBlock::isForSimulation_ = true
private

Definition at line 66 of file SinglePortSSRAMBlock.hh.

Referenced by write().

◆ memoryPortGroup_

NetlistPortGroup* ProGe::SinglePortSSRAMBlock::memoryPortGroup_ = nullptr
private

Definition at line 64 of file SinglePortSSRAMBlock.hh.

Referenced by memoryPort(), and SinglePortSSRAMBlock().


The documentation for this class was generated from the following files: