Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/kactus2/kactus2dev
Browse files Browse the repository at this point in the history
  • Loading branch information
teuhom committed Feb 13, 2024
2 parents 3a7ad27 + a924550 commit f586029
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ QList<QSharedPointer<GenerationOutput> > ModelSimWriterFactory::prepareDesign(QL

QList<QSharedPointer<MetaInstance> > components;

foreach (QSharedPointer<MetaDesign> mDesign, designs)
for (QSharedPointer<MetaDesign> mDesign : designs)
{
components.append(mDesign->getTopInstance());
components.append(mDesign->getInstances()->values());
Expand All @@ -63,14 +63,15 @@ QList<QSharedPointer<GenerationOutput> > ModelSimWriterFactory::prepareDesign(QL
document->writer_ = writer;
document->fileName_ = designs.first()->getTopInstance()->getModuleName() + ".do";
document->vlnv_ = designs.first()->getTopInstance()->getComponent()->getVlnv().toString();
document->metaDesign_ = designs.first();

foreach (QSharedPointer<MetaComponent> mComponent, components)
for (QSharedPointer<MetaComponent> mComponent : components)
{
QString basePath = library_->getPath(mComponent->getComponent()->getVlnv());

foreach (QSharedPointer<FileSet> fileSet, *mComponent->getFileSets())
for (QSharedPointer<FileSet> fileSet : *mComponent->getFileSets())
{
foreach (QSharedPointer<File> file, *fileSet->getFiles())
for (QSharedPointer<File> file : *fileSet->getFiles())
{
// Fetch the absolute path to the file
QString absolutePath = General::getAbsolutePath(basePath, file->name());
Expand Down
12 changes: 5 additions & 7 deletions Plugins/PluginSystem/GeneratorPlugin/GenerationControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,7 @@ bool GenerationControl::writeDocuments()
}

// If instantiation exists, make sure that the instantiation refers to the file set.
QStringList fileSetRefs = instantiation->getFileSetReferenceStrings();

if (instantiation && !fileSetRefs.contains(fileSet->name()))
if (instantiation && instantiation->getFileSetReferenceStrings().contains(fileSet->name()))
{
QSharedPointer<FileSetRef> newFileSetRef(new FileSetRef());
newFileSetRef->setReference(fileSet->name());
Expand All @@ -106,7 +104,7 @@ bool GenerationControl::writeDocuments()
bool fails = false;

// Go through each potential file.
foreach(QSharedPointer<GenerationOutput> output, *outputControl_->getOutputs())
for (QSharedPointer<GenerationOutput> output : *outputControl_->getOutputs())
{
// Form the path from the determined output path plus determined file name.
QString absFilePath = outputControl_->getOutputPath() + "/" + output->fileName_;
Expand Down Expand Up @@ -235,7 +233,7 @@ void GenerationControl::initializeDocuments()
QList<QSharedPointer<GenerationOutput> > documents = factory_->prepareDesign(designs);

// Go through the parsed designs.
foreach(QSharedPointer<GenerationOutput> output, documents)
for (QSharedPointer<GenerationOutput> output : documents)
{
if (!output)
{
Expand Down Expand Up @@ -421,7 +419,7 @@ QSharedPointer<QList<QSharedPointer<View> > > GenerationControl::findPossibleVie
}

// Go through each view of the containing component and pick the eligible ones.
foreach(QSharedPointer<View> view, *input.component->getViews())
for (QSharedPointer<View> view : *input.component->getViews())
{
// Find the design instantiation of the view.
QSharedPointer<DesignInstantiation> dis = input.component->getModel()->
Expand Down Expand Up @@ -469,7 +467,7 @@ QSharedPointer<QList<QSharedPointer<View> > > GenerationControl::findPossibleVie
(new QList<QSharedPointer<View> >);

// In practice, go through each view, and if it is not hierarchical, append to the list.
foreach (QSharedPointer<View> view, *targetComponent->getViews())
for (QSharedPointer<View> view : *targetComponent->getViews())
{
if (!view->isHierarchical())
{
Expand Down

0 comments on commit f586029

Please sign in to comment.