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

#include <NetlistBlock.hh>

Inheritance diagram for ProGe::NetlistBlock:
Inheritance graph
Collaboration diagram for ProGe::NetlistBlock:
Collaboration graph

Public Member Functions

 NetlistBlock (const std::string &moduleName, const std::string &instanceName, BaseNetlistBlock *parent=NULL)
 
virtual ~NetlistBlock ()
 
void setParameter (const std::string &name, const std::string &type, const std::string &value)
 
void removePort (NetlistPort &port)
 
virtual NetlistPortport (const std::string &portName, bool partialMatch=true)
 
NetlistBlocksubBlock (size_t index) override
 
virtual const NetlistBlockparentBlock () const override
 
virtual NetlistBlockparentBlock () override
 
NetlistBlockshallowCopy (const std::string &instanceName) const
 
virtual void write (const Path &targetBaseDir, HDL targetLang=VHDL) const override
 
void addParameter (const Parameter &param)
 
void setParameter (const Parameter &param)
 
virtual const Parameterparameter (const std::string &name) const
 
virtual const Parameterparameter (size_t index) const
 
Parameterparameter (const std::string &name)
 
NetlistPortaddPort (NetlistPort *port)
 
void removePort (NetlistPort *port)
 
virtual size_t portCount () const
 
virtual const NetlistPortport (size_t index) const
 
virtual const NetlistPortport (const std::string &portName, bool partialMatch=true) const
 
virtual NetlistPortport (size_t index)
 
void addPortGroup (NetlistPortGroup *portGroup)
 
void addSubBlock (BaseNetlistBlock *subBlock, const std::string &instanceName="")
 
virtual size_t subBlockCount () const
 
virtual const Netlistnetlist () const
 
Netlistnetlist ()
 
void addPackage (const std::string &packageName)
 
virtual size_t packageCount () const
 
virtual const std::string & package (size_t idx) const
 
- 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 const BaseNetlistBlocksubBlock (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 size_t parameterCount () const
 
virtual std::vector< const NetlistPort * > portsBy (SignalType type) const
 
virtual const NetlistPortportBy (SignalType type, size_t index=0) const
 
virtual bool hasPortsBy (SignalType type) const
 
virtual size_t portGroupCount () const
 
virtual const NetlistPortGroupportGroup (size_t index) const
 
virtual std::vector< const NetlistPortGroup * > portGroupsBy (SignalGroupType type) const
 
virtual bool hasParentBlock () 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
 
PortContainerTypeports ()
 
virtual bool isLeaf () const
 
BaseNetlistBlockshallowCopy (const std::string &instanceName="") const
 
- Public Member Functions inherited from ProGe::IGenerationPhases
virtual ~IGenerationPhases ()
 

Additional Inherited Members

- Public Types inherited from ProGe::BaseNetlistBlock
typedef std::vector< BaseNetlistBlock * > BlockContainerType
 
typedef std::vector< ParameterParameterContainerType
 
typedef std::vector< NetlistPort * > PortContainerType
 
typedef std::vector< NetlistPortGroup * > PortGroupContainerType
 
- Protected Member Functions inherited from ProGe::BaseNetlistBlock
Netlistnetlist ()
 
void setModuleName (const std::string &name)
 
void addSubBlock (BaseNetlistBlock *subBlock, const std::string &instanceName="")
 
void deleteSubBlock (BaseNetlistBlock *subBlock)
 
void removeSubBlock (BaseNetlistBlock *subBlock)
 
NetlistPortaddPort (NetlistPort *port)
 
void removePort (NetlistPort *port)
 
void addPortGroup (NetlistPortGroup *portGroup)
 
void removePortGroup (NetlistPortGroup *portGroup)
 
void setParameter (const Parameter &param)
 
void addParameter (const Parameter &param)
 
Parameterparameter (const std::string &name)
 
NetlistPortfindPort (const std::string &portName, bool recursiveSearch=false, bool partialMatch=true) const
 
void addPackage (const std::string &packageName)
 
void connectClocks ()
 
void connectResets ()
 

Detailed Description

Represents a hardware block in the netlist.

Definition at line 61 of file NetlistBlock.hh.

Constructor & Destructor Documentation

◆ NetlistBlock()

ProGe::NetlistBlock::NetlistBlock ( const std::string &  moduleName,
const std::string &  instanceName,
BaseNetlistBlock parent = NULL 
)

Constructor. Creates a netlist with no ports.

The created is empty. Only its name, the parent netlist and the name of the instance module are defined.

Parameters
moduleNameName of the module.
instanceNameName of the instance of the module.
netlistThe netlist which the belongs to.

Definition at line 68 of file NetlistBlock.cc.

const std::string & instanceName() const
const std::string & moduleName() const

◆ ~NetlistBlock()

ProGe::NetlistBlock::~NetlistBlock ( )
virtual

The destructor.

Deletes all the ports.

Definition at line 78 of file NetlistBlock.cc.

78 {
79}

Member Function Documentation

◆ addPackage()

void ProGe::BaseNetlistBlock::addPackage ( const std::string &  packageName)

Definition at line 162 of file BaseNetlistBlock.cc.

687 {
688 if (!ContainerTools::containsValue(packages_, packageName)) {
689 packages_.push_back(packageName);
690 }
691}
static bool containsValue(const ContainerType &aContainer, const ElementType &aKey)
std::vector< std::string > packages_
The referenced packages by the module.

Referenced by PlatformIntegrator::copyProgeBlockToNetlist(), ProGe::NetlistGenerator::generate(), DefaultICDecoderGenerator::generateDebuggerCode(), and shallowCopy().

◆ addParameter()

void ProGe::BaseNetlistBlock::addParameter ( const Parameter param)

Adds new parameter to the block. Throws exception if the block has the parameter by the name already.

Definition at line 156 of file BaseNetlistBlock.cc.

547 {
548 // Check for uniqueness //
549 for (Parameter& p : parameters_) {
550 if (p.name() == param.name()) {
552 __FILE__, __LINE__,
553 "The block \"" + name() + "\" already has parameter\"" +
554 param.name() + "\"");
555 }
556 }
557
558 // Check if parameter's value refers to a constant //
559 if (param.valueIsConstant()) {
560 std::string packageName = param.packageNameOfConstant();
561 assert(!packageName.empty());
562 addPackage(packageName);
563 }
564
565 parameters_.push_back(param);
566}
#define assert(condition)
ParameterContainerType parameters_
The parameters of the block.
const std::string name() const
void addPackage(const std::string &packageName)

Referenced by ProGe::NetlistGenerator::addGCUToNetlist().

◆ addPort()

NetlistPort * ProGe::BaseNetlistBlock::addPort ( NetlistPort port)

Adds port to this block and acquires ownership of it.

Added port will point to this block after the call.

Exceptions
ObjectAlreadyExistsThrown if the netlist block already has a port by same name.

Definition at line 151 of file BaseNetlistBlock.cc.

467 {
468 assert(port != nullptr && "Attempted to add null port.");
469 if (findPort(port->name(), false, false)) {
472 "Given port by name (" + port->name() +
473 ") already exists in the netlist block (" +
474 this->instanceName() + " : " + this->moduleName() + ").");
475 }
476
477 if (!port->hasParentBlock() || &port->parentBlock() != this) {
478 port->setParent(this);
479 }
480 ports_.push_back(port);
482 if (parent_ != nullptr) {
484 }
485 return port;
486}
#define THROW_EXCEPTION(exceptionType, message)
Exception wrapper macro that automatically includes file name, line number and function name where th...
Definition Exception.hh:39
PortContainerType ports_
The ports of the block.
BaseNetlistBlock * parent_
The reference to parent block of this block.
Netlist * netlist_
The netlist of the block.
NetlistPort * findPort(const std::string &portName, bool recursiveSearch=false, bool partialMatch=true) const
virtual NetlistPort * port(const std::string &portName, bool partialMatch=true)
void setParent(BaseNetlistBlock *parent)
bool hasParentBlock() const
const BaseNetlistBlock & parentBlock() const
std::string name() const
size_t registerPort(NetlistPort &port)
Definition Netlist.cc:309

◆ addPortGroup()

void ProGe::BaseNetlistBlock::addPortGroup ( NetlistPortGroup portGroup)

Definition at line 153 of file BaseNetlistBlock.cc.

508 {
509 portGroups_.push_back(portGroup);
510 portGroup->setParent(this);
511 for (size_t i = 0; i < portGroup->portCount(); i++) {
512 if (!netlist().isRegistered(portGroup->portAt(i))) {
514 }
515 }
516}
PortGroupContainerType portGroups_
The ports of the block.
virtual const NetlistPortGroup & portGroup(size_t index) const
NetlistPort * addPort(NetlistPort *port)
virtual const Netlist & netlist() const
const NetlistPort & portAt(size_t index) const
void setParent(BaseNetlistBlock *newParent)

Referenced by ProGe::NetlistGenerator::addFUExternalPortsToNetlist(), ProGe::NetlistGenerator::addGCUToNetlist(), FUGen::createExternalInterfaces(), AlmaIFIntegrator::initAlmaifBlock(), and shallowCopy().

◆ addSubBlock()

void ProGe::BaseNetlistBlock::addSubBlock ( BaseNetlistBlock subBlock,
const std::string &  instanceName = "" 
)

Adds sub block to this block and acquires ownership of it.

Parameters
subBlockThe block to be added.
instanceNameThe instance base name to be given for sub block. If the given or sub block's instance name is not unique within the block The name will be prefixed with a running number.

Definition at line 146 of file BaseNetlistBlock.cc.

406 {
407 if (!instanceName.empty()) {
410 } else {
411 if (subBlock->instanceName().empty()) {
413 *this, subBlock->moduleName() + "_inst0"));
414 } else {
416 *this, subBlock->instanceName()));
417 }
418 }
419
421 subBlock->setParent(this);
422 subBlocks_.push_back(subBlock);
423
424 // Register ports of the subblock so connections can be made.
425 for (size_t i = 0; i < subBlock->portCount(); i++) {
427 }
428}
BlockContainerType subBlocks_
The sub blocks of this netlist block.
void setInstanceName(const std::string &name)
std::string instanceName_
The instance name of the block.
virtual bool hasParentBlock() const
virtual void setParent(BaseNetlistBlock *parent)
NetlistBlock & subBlock(size_t index) override
virtual size_t portCount() const
virtual const NetlistBlock & parentBlock() const override
static std::string getUniqueInstanceName(const BaseNetlistBlock &within, const std::string &basename)

Referenced by ProGe::NetlistGenerator::addBaseRFToNetlist(), ProGe::NetlistGenerator::addFUToNetlist(), ProGe::NetlistGenerator::addGCUToNetlist(), ProGe::NetlistGenerator::addGeneratableFUsToNetlist(), DefaultICGenerator::addICToNetlist(), MemoryGenerator::addMemory(), XilinxBlockRamGenerator::addMemory(), DefaultICDecoderGenerator::addRV32MicroCode(), MemoryGenerator::connectPorts(), PlatformIntegrator::copyProgeBlockToNetlist(), MemoryGenerator::createMemoryNetlistBlock(), and DefaultICDecoderGenerator::generateDebuggerCode().

◆ netlist() [1/2]

Netlist & ProGe::BaseNetlistBlock::netlist ( )

Definition at line 139 of file BaseNetlistBlock.cc.

681 {
682 assert(netlist_ != nullptr);
683 return *netlist_;
684}

◆ netlist() [2/2]

const Netlist & ProGe::BaseNetlistBlock::netlist ( ) const
virtual

◆ package()

const std::string & ProGe::BaseNetlistBlock::package ( size_t  idx) const
virtual

Reimplemented from ProGe::BaseNetlistBlock.

Definition at line 123 of file BaseNetlistBlock.cc.

699 {
700 return packages_.at(idx);
701}

References ProGe::BaseNetlistBlock::subBlocks_.

Referenced by PlatformIntegrator::copyProgeBlockToNetlist(), and shallowCopy().

◆ packageCount()

size_t ProGe::BaseNetlistBlock::packageCount ( ) const
virtual

Reimplemented from ProGe::BaseNetlistBlock.

Definition at line 122 of file BaseNetlistBlock.cc.

694 {
695 return packages_.size();
696}

Referenced by PlatformIntegrator::copyProgeBlockToNetlist(), and shallowCopy().

◆ parameter() [1/3]

Parameter & ProGe::BaseNetlistBlock::parameter ( const std::string &  name)

Returns a Parameter object by name.

Exceptions
NotAvailableThrown if the block does not have such Parameter.

Definition at line 157 of file BaseNetlistBlock.cc.

217 {
218 for (size_t i = 0; i < parameterCount(); i++) {
219 if (parameters_.at(i).name() == name) {
220 return parameters_.at(i);
221 }
222 }
223
224 throw NotAvailable(
225 __FILE__, __LINE__, __func__,
226 std::string("The block (") + instanceName() + ":" + moduleName() +
227 ") does not have parameter \"" + name + "\"");
228}
#define __func__
virtual size_t parameterCount() const

◆ parameter() [2/3]

const Parameter & ProGe::BaseNetlistBlock::parameter ( const std::string &  name) const
virtual

Returns a Parameter object by name.

Exceptions
NotAvailableThrown if the block does not have such Parameter.

Reimplemented from ProGe::BaseNetlistBlock.

Definition at line 89 of file BaseNetlistBlock.cc.

198 {
199 for (size_t i = 0; i < parameterCount(); i++) {
200 if (parameter(i).name() == name) {
201 return parameter(i);
202 }
203 }
204
205 throw NotAvailable(
206 __FILE__, __LINE__, __func__,
207 std::string("The block (") + instanceName() + ":" + moduleName() +
208 ") does not have parameter \"" + name + "\"");
209}
virtual const Parameter & parameter(const std::string &name) const
const TCEString & name() const
Definition Parameter.cc:133

Referenced by ProGe::NetlistGenerator::addBaseRFToNetlist(), ProGe::NetlistGenerator::addFUExternalPortsToNetlist(), PlatformIntegrator::copyProgeBlockToNetlist(), shallowCopy(), SOPCBuilderFileGenerator::writeGenerics(), and IPXactFileGenerator::writeProjectFiles().

◆ parameter() [3/3]

const Parameter & ProGe::BaseNetlistBlock::parameter ( size_t  index) const
virtual

Reimplemented from ProGe::BaseNetlistBlock.

Definition at line 91 of file BaseNetlistBlock.cc.

236 {
237 if (index >= parameterCount()) {
238 throw OutOfRange(__FILE__, __LINE__, __func__);
239 }
240
241 return parameters_.at(index);
242}

◆ parentBlock() [1/2]

const NetlistBlock & ProGe::NetlistBlock::parentBlock ( ) const
overridevirtual

Returns the parent .

Returns
The parent .
Exceptions
InstanceNotFoundIf the does not have a parent .

Reimplemented from ProGe::BaseNetlistBlock.

Definition at line 126 of file NetlistBlock.cc.

126 {
127 if (!hasParentBlock()) {
128 const string procName = "NetlistBlock::parentBlock";
129 throw InstanceNotFound(__FILE__, __LINE__, procName);
130 }
131
132 // todo: fix parentblock may not be NetlistBlock.
133 return *dynamic_cast<const NetlistBlock*>(
135}
virtual const BaseNetlistBlock & parentBlock() const
NetlistBlock(const std::string &moduleName, const std::string &instanceName, BaseNetlistBlock *parent=NULL)

References ProGe::BaseNetlistBlock::hasParentBlock(), and ProGe::BaseNetlistBlock::parentBlock().

Referenced by DefaultDecoderGenerator::addGlockPortToDecoder(), DefaultDecoderGenerator::addLockReqPortToDecoder(), and DefaultICDecoderGenerator::generateDebuggerCode().

Here is the call graph for this function:

◆ parentBlock() [2/2]

NetlistBlock & ProGe::NetlistBlock::parentBlock ( )
overridevirtual

Returns the parent .

Returns
The parent .
Exceptions
InstanceNotFoundIf the does not have a parent .

Reimplemented from ProGe::BaseNetlistBlock.

Definition at line 144 of file NetlistBlock.cc.

144 {
145 if (!hasParentBlock()) {
146 const string procName = "NetlistBlock::parentBlock";
147 throw InstanceNotFound(__FILE__, __LINE__, procName);
148 }
149
150 return *dynamic_cast<NetlistBlock*>(&BaseNetlistBlock::parentBlock());
151}

References ProGe::BaseNetlistBlock::hasParentBlock(), and ProGe::BaseNetlistBlock::parentBlock().

Here is the call graph for this function:

◆ port() [1/4]

NetlistPort * ProGe::NetlistBlock::port ( const std::string &  portName,
bool  partialMatch = true 
)
virtual

◆ port() [2/4]

const NetlistPort * ProGe::BaseNetlistBlock::port ( const std::string &  portName,
bool  partialMatch = true 
) const
virtual

Returns a port that matches (partially) the given name.

Returns
The matching port. If not found, returns nullptr.

Reimplemented from ProGe::BaseNetlistBlock.

Definition at line 98 of file BaseNetlistBlock.cc.

317 {
318 return findPort(portName, false, partialMatch);
319}

◆ port() [3/4]

NetlistPort & ProGe::BaseNetlistBlock::port ( size_t  index)
virtual

Reimplemented from ProGe::BaseNetlistBlock.

Definition at line 141 of file BaseNetlistBlock.cc.

322 {
323 return *ports_.at(index);
324}

◆ port() [4/4]

const NetlistPort & ProGe::BaseNetlistBlock::port ( size_t  index) const
virtual

Reimplemented from ProGe::BaseNetlistBlock.

Definition at line 94 of file BaseNetlistBlock.cc.

253 {
254 return *ports_.at(index);
255}

◆ portCount()

size_t ProGe::BaseNetlistBlock::portCount ( ) const
virtual

◆ removePort() [1/2]

void ProGe::NetlistBlock::removePort ( NetlistPort port)

References write().

Here is the call graph for this function:

◆ removePort() [2/2]

void ProGe::BaseNetlistBlock::removePort ( NetlistPort port)

Removes the given port from the block.

After call the port is parent block reference is set to nullptr.

Definition at line 152 of file BaseNetlistBlock.cc.

494 {
495 assert(
496 &port->parentBlock() == this &&
497 "Attempted to remove a port the block does not have.");
498
500 if (this->hasParentBlock()) {
502 }
504 port->setParent(nullptr);
505}
static bool removeValueIfExists(ContainerType &aContainer, const ElementType &aKey)
void unregisterPort(NetlistPort &port)
Definition Netlist.cc:342

◆ setParameter() [1/2]

void ProGe::BaseNetlistBlock::setParameter ( const Parameter param)

Adds parameter to the block overwriting the existing one by name.

Definition at line 155 of file BaseNetlistBlock.cc.

532 {
533 for (Parameter& p : parameters_) {
534 if (p.name() == param.name()) {
535 p = param;
536 return;
537 }
538 }
539 parameters_.push_back(param);
540}

◆ setParameter() [2/2]

void ProGe::NetlistBlock::setParameter ( const std::string &  name,
const std::string &  type,
const std::string &  value 
)

◆ shallowCopy()

NetlistBlock * ProGe::NetlistBlock::shallowCopy ( const std::string &  instanceName) const

Copies the block without its children or internal connections - leaving only the outer portion of the block.

Parameters
instanceNameNew instance name for the copy
Returns
Pointer to the netlist copy

Definition at line 161 of file NetlistBlock.cc.

161 {
162 NetlistBlock* block =
163 new NetlistBlock(this->moduleName(), instanceName, NULL);
164
165 for (size_t i = 0; i < this->parameterCount(); i++) {
166 block->setParameter(this->parameter(i));
167 }
168 for (size_t i = 0; i < netlist().parameterCount(); i++) {
169 block->netlist().setParameter(this->netlist().parameter(i));
170 }
171 // Copy ports while preserving their insertion order.
172 std::map<std::string, NetlistPort*> copiedPorts;
173 for (size_t i = 0; i < portCount(); i++) {
174 NetlistPort* copiedPort = nullptr;
175 copiedPort = BaseNetlistBlock::port(i).copyTo(*block);
176 copiedPorts.insert({{copiedPort->name(), copiedPort}});
177 }
178 for (size_t i = 0; i < portGroupCount(); i++) {
179 const NetlistPortGroup* portGrp = &portGroup(i);
180 // Cloning to copy original class type, but clear ports as they are
181 // already created and added to the new block.
182 NetlistPortGroup* newGroup = portGrp->clone();
183 newGroup->clear();
184 for (auto port : *portGrp) {
185 newGroup->addPort(*copiedPorts.at(port->name()));
186 }
187 block->addPortGroup(newGroup);
188 }
189
190 for (size_t i = 0; i < packageCount(); i++) {
191 block->addPackage(this->package(i));
192 }
193
194 return block;
195}
virtual size_t portGroupCount() const
virtual const NetlistPort & port(size_t index) const
virtual size_t packageCount() const
virtual const std::string & package(size_t idx) const
NetlistPort * copyTo(BaseNetlistBlock &newParent, std::string newName="") const
size_t parameterCount() const
Definition Netlist.cc:422
Parameter parameter(size_t index) const
Definition Netlist.cc:434

References addPackage(), ProGe::NetlistPortGroup::addPort(), addPortGroup(), ProGe::NetlistPortGroup::clear(), ProGe::NetlistPortGroup::clone(), ProGe::NetlistPort::copyTo(), ProGe::BaseNetlistBlock::moduleName(), ProGe::NetlistPort::name(), netlist(), package(), packageCount(), parameter(), ProGe::Netlist::parameter(), ProGe::BaseNetlistBlock::parameterCount(), ProGe::Netlist::parameterCount(), port(), ProGe::BaseNetlistBlock::port(), portCount(), ProGe::BaseNetlistBlock::portGroup(), ProGe::BaseNetlistBlock::portGroupCount(), ProGe::Netlist::setParameter(), and setParameter().

Referenced by PlatformIntegrator::copyProgeBlockToNetlist().

Here is the call graph for this function:

◆ subBlock()

NetlistBlock & ProGe::NetlistBlock::subBlock ( size_t  index)
overridevirtual

Returns a sub by the given index.

Parameters
indexThe index.
Returns
The sub .
Exceptions
OutOfRangeIf the given index is negative or not smaller than the number of sub blocks.

Reimplemented from ProGe::BaseNetlistBlock.

Definition at line 110 of file NetlistBlock.cc.

110 {
111 if (index >= subBlockCount()) {
112 throw OutOfRange(__FILE__, __LINE__, __func__);
113 }
114
115 // todo check for and throw wrong subblass
116 return *dynamic_cast<NetlistBlock*>(&BaseNetlistBlock::subBlock(index));
117}
virtual const BaseNetlistBlock & subBlock(size_t index) const
virtual size_t subBlockCount() const

References __func__, ProGe::BaseNetlistBlock::subBlock(), and subBlockCount().

Referenced by FUGen::FUGen(), and DefaultICDecoderGenerator::generateDebuggerCode().

Here is the call graph for this function:

◆ subBlockCount()

size_t ProGe::BaseNetlistBlock::subBlockCount ( ) const
virtual

◆ write()

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

Writes self if non-empty and calls write() function of each sub block.

Reimplemented from ProGe::BaseNetlistBlock.

Definition at line 201 of file NetlistBlock.cc.

201 {
202 if (netlist().hasConnections()) {
203 NetlistWriter* writer;
204 std::string topLevelDir = "";
205 if (targetLang == ProGe::VHDL) {
206 writer = new VHDLNetlistWriter(*this);
207 topLevelDir = targetBaseDir.string() +
209 } else if (targetLang == ProGe::Verilog) {
210 writer = new VerilogNetlistWriter(*this);
211 topLevelDir = targetBaseDir.string() +
213 } else {
214 assert(false && "Unsupported HDL.");
215 }
216
217 if (!FileSystem::fileExists(topLevelDir)) {
218 bool directoryCreated = FileSystem::createDirectory(topLevelDir);
219 if (!directoryCreated) {
220 std::string errorMsg =
221 "Unable to create directory " + topLevelDir + ".";
222 throw IOException(__FILE__, __LINE__, __func__, errorMsg);
223 }
224 }
225
226 writer->write(topLevelDir);
227 delete writer;
228 }
229
230 BaseNetlistBlock::write(targetBaseDir, targetLang);
231}
static bool createDirectory(const std::string &path)
static const std::string DIRECTORY_SEPARATOR
static bool fileExists(const std::string fileName)
virtual void write(const Path &targetBaseDir, HDL targetLang=VHDL) const override
@ Verilog
Verilog.
Definition ProGeTypes.hh:42
@ VHDL
VHDL.
Definition ProGeTypes.hh:41

References __func__, assert, FileSystem::createDirectory(), FileSystem::DIRECTORY_SEPARATOR, FileSystem::fileExists(), netlist(), ProGe::Verilog, ProGe::VHDL, ProGe::BaseNetlistBlock::write(), and ProGe::NetlistWriter::write().

Referenced by ProGe::ProcessorGenerator::generateProcessor(), and removePort().

Here is the call graph for this function:

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