Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[CORRECTIVE] Made some changes needed for the Linux installation to w…
…ork.

git-svn-id: svn://svn.code.sf.net/p/kactus2/code/trunk@2645 f0aa6db5-7f46-43cc-a8a5-a31efdaafa67
  • Loading branch information
TermosPullo committed Dec 1, 2016
1 parent b4f0e91 commit d6b673b
Show file tree
Hide file tree
Showing 10 changed files with 225 additions and 147 deletions.
2 changes: 1 addition & 1 deletion Help/communityGuideLines.html
Expand Up @@ -17,7 +17,7 @@ <h2>Community Guidelines</h2>
</p>
<ul>
<li>When creating a plugin, you may keep it closed or open source, and the copyright stays with you.</li>
<li>When contributing to Kactus2 core, the IP-XACT library or plugins provided by TUT, the changes will not make to
<li>When contributing to Kactus2 core, the IP-XACTmodels library or the plugins provided by TUT, the changes will not make to
a release unless we accept them and you agree to transfer the copyrights of the changes to TUT.</li>
</ul>
</body>
Expand Down
2 changes: 1 addition & 1 deletion Plugins/MemoryViewGenerator/MemoryViewGenerator.pro
Expand Up @@ -23,5 +23,5 @@ UI_DIR += ./GeneratedFiles
RCC_DIR += ./GeneratedFiles
include(MemoryViewGenerator.pri)

target.path = /usr/share/kactus2/plugins
target.path = $$plugin_path
INSTALLS += target
3 changes: 2 additions & 1 deletion Plugins/PluginSystem/GeneratorPlugin/ViewSelection.cpp
Expand Up @@ -47,9 +47,10 @@ ViewSelection::ViewSelection( QString targetLanguage,
{
QSharedPointer<ComponentInstantiation> cimp = instantiations_[view->getComponentInstantiationRef()];

if (cimp && cimp->getLanguage() == targetLanguage_)
if (cimp && cimp->getLanguage().toLower() == targetLanguage_.toLower())
{
view_ = view;
break;
}
}

Expand Down
Expand Up @@ -150,7 +150,7 @@ void ViewSelectionWidget::setLanguage(QString selectedLanguage)
}

// Select color depending on match.
if (selectedLanguage == configuration_->getTargetLanguage())
if (selectedLanguage.toLower() == configuration_->getTargetLanguage().toLower())
{
instantiationLanguage_->setStyleSheet("QLabel { color : green; }");
}
Expand Down
180 changes: 89 additions & 91 deletions Plugins/common/HDLParser/HDLDesignParser.cpp
Expand Up @@ -90,7 +90,7 @@ void HDLDesignParser::parseDesign(QSharedPointer<GenerationComponent> topCompone
findInternalAdhocs();
assignInternalAdHocs();

// Hiearchical ad hocs need to be considered separately.
// Hierarchical ad-hocs need to be considered separately.
parseHierarchicallAdhocs();

// Finally add the parsed design to the list.
Expand Down Expand Up @@ -574,7 +574,7 @@ void HDLDesignParser::assignLargerBounds(QSharedPointer<GenerationWire> wire, QP

// Check the size of the new bounds.
newBounds.first = boundCand.first.toInt();
newBounds.second = boundCand.second.toInt();;
newBounds.second = boundCand.second.toInt();

// Find the widest alignment order of the new bounds.
int maxAlignment1 = qMax(newBounds.first, newBounds.second);
Expand All @@ -584,7 +584,7 @@ void HDLDesignParser::assignLargerBounds(QSharedPointer<GenerationWire> wire, QP

// Check the size of the existing bounds.
existingBound.first = wire->bounds.first.toInt();
existingBound.second = wire->bounds.second.toInt();;
existingBound.second = wire->bounds.second.toInt();

// Find the widest alignment order of the existing bounds.
int maxAlignment2 = qMax(existingBound.first, existingBound.second);
Expand Down Expand Up @@ -620,57 +620,93 @@ void HDLDesignParser::findInternalAdhocs()
QSharedPointer<GenerationAdHoc> gah;

// ...and ports connected to it.
QList<QPair<QString,QString> > foundPorts;
QList<QSharedPointer<GenerationPortAssignMent> > foundPorts;

// Go through the port references within the ad-hoc connection.
foreach(QSharedPointer<PortReference> internalPort, *adHocConnection->getInternalPortReferences())
{
// Pair the instance and the port.
QPair<QString,QString> port;
port.first = internalPort->getComponentRef();
port.second = internalPort->getPortRef();
foundPorts.append(port);

// Go through existing detected ad-hocs.
foreach(QSharedPointer<GenerationAdHoc> existing, retval_->adHocs_)
{
typedef QPair<QString, QString> customPair;
foreach(customPair theirPort, existing->ports)
{
// If both instance and port matches, we use this ad-hoc connection.
if (theirPort.first == port.first && theirPort.second == port.second)
{
gah = existing;
break;
}
}
{
QSharedPointer<GenerationInstance> gi = retval_->instances_.value(internalPort->getComponentRef());

if(gah)
{
break;
}
}
// If instance could not be found, the port reference must be discarded.
if (!gi)
{
continue;
}

// If the referred port is not found from the component of the instance, it cannot be used.
QSharedPointer<GenerationPort> ourPort = gi->component->ports.value(internalPort->getPortRef());

if (!ourPort)
{
continue;
}

// Find the matching port assignment.
QSharedPointer<GenerationPortAssignMent> gpa = gi->portAssignments_.value(ourPort->port->name());

// Create a new one if not found.
if (!gpa)
{
gpa = QSharedPointer<GenerationPortAssignMent>(new GenerationPortAssignMent);
gi->portAssignments_.insert(ourPort->port->name(),gpa);
gpa->port = ourPort;
gpa->adhoc = true;

// Try to apply a tie-off value.
gpa->tieOff = connectTieOff(adHocConnection->getTiedValue(), ourPort, DirectionTypes::IN);

// Assigning bounds.
QPair<QString,QString> bounds;

if (internalPort->getPartSelect() && !internalPort->getPartSelect()->getLeftRange().isEmpty()
&& !internalPort->getPartSelect()->getRightRange().isEmpty())
{
// If Part select exists, it shall be used.
bounds.first = internalPort->getPartSelect()->getLeftRange();
bounds.second = internalPort->getPartSelect()->getRightRange();
}
else
{
// Otherwise, since it is an ad-hoc connection, a physical port is the only choice.
bounds = physicalPortBoundsInInstance(gi, ourPort);
}

// Assign the bounds.
gpa->bounds = bounds;
}

// Go through existing detected ad-hocs.
foreach(QSharedPointer<GenerationAdHoc> existing, retval_->adHocs_)
{
if (existing->ports.contains(gpa))
{
gah = existing;
break;
}
}

if (!foundPorts.contains(gpa))
{
foundPorts.append(gpa);
}
}

// If the instance and its port was not found in existing ones, create a new.
if (!gah)
{
gah = QSharedPointer<GenerationAdHoc>(new GenerationAdHoc);

// Create the wire of the ad hoc connection.
QSharedPointer<GenerationWire> gw(new GenerationWire);
gw->name = adHocConnection->name();
gah->wire = gw;
{
// If the instance and its port was not found in existing ones, create a new.
gah = QSharedPointer<GenerationAdHoc>(new GenerationAdHoc);

// If any tied value exists, it will be recorded as well.
gah->tieOff = adHocConnection->getTiedValue();
// Create the wire of the ad hoc connection.
QSharedPointer<GenerationWire> gw(new GenerationWire);
gw->name = adHocConnection->name();
gah->wire = gw;

// Add to the pool of existing ones.
retval_->adHocs_.append(gah);
}
retval_->adHocs_.append(gah);
}

// Finally, the found pairs are appended to the connection.
gah->ports.append(foundPorts);
// Finally, the found pairs are appended to the connection.
gah->ports.append(foundPorts);
}
}

Expand All @@ -679,58 +715,20 @@ void HDLDesignParser::findInternalAdhocs()
//-----------------------------------------------------------------------------
void HDLDesignParser::assignInternalAdHocs()
{
// Go through each instance.
foreach (QSharedPointer<GenerationInstance> gi, retval_->instances_)
// Go through each detected internal adhoc interconnection.
foreach(QSharedPointer<GenerationAdHoc> existing, retval_->adHocs_)
{
// Go through each detected internal adhoc interconnection.
foreach(QSharedPointer<GenerationAdHoc> existing, retval_->adHocs_)
// Go through each port reference associated with the interconnection.
foreach(QSharedPointer<GenerationPortAssignMent> theirPort, existing->ports)
{
// Go through each port reference associated with the interconnection.
typedef QPair<QString, QString> customPair;
foreach(customPair theirPort, existing->ports)
if (theirPort->tieOff.isEmpty())
{
// If the instance name does not match, it does not belong to this instance.
if (theirPort.first != gi->componentInstance_->getInstanceName())
{
continue;
}
// If no tie-off connection cannot be applied, the wire is used.
QSharedPointer<GenerationWire> gw = existing->wire;
theirPort->wire = gw;

// If the port is not found from the component of the instance, it cannot be used.
QSharedPointer<GenerationPort> ourPort = gi->component->ports.value(theirPort.second);

if (!ourPort)
{
continue;
}

// Find the matching port assignment.
QSharedPointer<GenerationPortAssignMent> gpa = gi->portAssignments_.value(ourPort->port->name());

// Create a new one if not found.
if (!gpa)
{
gpa = QSharedPointer<GenerationPortAssignMent>(new GenerationPortAssignMent);
gi->portAssignments_.insert(ourPort->port->name(),gpa);
gpa->port = ourPort;
gpa->adhoc = true;
}

// Try to apply a tie off value.
gpa->tieOff = connectTieOff(existing->tieOff, ourPort, DirectionTypes::IN);

if (gpa->tieOff.isEmpty())
{
// If no tie-off connection cannot be applied, the wire is used.
QSharedPointer<GenerationWire> gw = existing->wire;
gpa->wire = gw;

// Since it is an ad-hoc connection, a physical connection is the only choice.
QPair<QString,QString> bounds = physicalPortBoundsInInstance(gi, ourPort);

// Assign if they are larger than existing ones.
assignLargerBounds(gw, bounds);
gpa->bounds = gw->bounds;
}
// Assign if they are larger than existing ones.
assignLargerBounds(gw, theirPort->bounds);
}
}
}
Expand Down
18 changes: 8 additions & 10 deletions Plugins/common/HDLParser/HDLParserCommon.h
Expand Up @@ -143,16 +143,6 @@ struct GenerationWire
QString name;
};

struct GenerationAdHoc
{
//! The ports of the ad-hoc interconnection.
QList<QPair<QString,QString> > ports;
//! The wire of the ad-hoc connection.
QSharedPointer<GenerationWire> wire;
//! If this is actually tied value assignment, this is non-empty.
QString tieOff;
};

struct GenerationInterconnection
{
//! The interfaces assigned to the interconnection.
Expand Down Expand Up @@ -191,6 +181,14 @@ struct GenerationPortAssignMent
bool adhoc;
};

struct GenerationAdHoc
{
//! The ports of the ad-hoc interconnection.
QList<QSharedPointer<GenerationPortAssignMent> > ports;
//! The wire of the ad-hoc connection.
QSharedPointer<GenerationWire> wire;
};

struct GenerationInstance
{
//! The component referenced by the instance.
Expand Down
75 changes: 40 additions & 35 deletions README.Linux
@@ -1,55 +1,60 @@
In order to build Kactus2, Qt5 must be installed on your system.
There are two ways to do this:
1. To build and run Kactus2, Qt5 must be installed on your system.
There are two ways to do this:

A) Installing Qt5 packages through the package manager (needs admin privileges)
A) Installing required Qt5 packages through the package manager (needs admin privileges)

The following packages are needed:
qt5-default
libqt5xmlpatterns5-dev
qttools5-private-dev
qttools5-dev-tools
On Ubuntu the following packages are needed:
qt5-default
libqt5xmlpatterns5-dev
qttools5-private-dev
qttools5-dev-tools

B) Manually downloading and installing from http://qt-project.org/downloads
B) Manually downloading and installing from https://www.qt.io/download/

However, when using manually installed Qt5, you need to make sure that Kactus2 is installed
using its files. Open file configure and set the binary path of Qt5 as the value of variable QTBIN_PATH.
Notice that you need to have a slash at the end of the path.
When using manually installed Qt5, you need to make sure that Kactus2 is installed using its files:
Open file configure at the directory of Kactus2 and set the path of Qt5 build commands as the value of variable
QTBIN_PATH. Notice that you need to have a slash at the end of the path.

Example: QTBIN_PATH="/home/username/Qt/5.7/gcc_64/bin/"

After successful installation of Qt5, change to directory of Kactus2.
There are two ways to build:
2. After successful installation of Qt5, change to the directory of Kactus2.
There are two ways to build:

A) An installation for all users, using admin privileges:
./configure
make
make install (needs admin privileges)
A) An installation for all users, using admin privileges:
./configure
make
make install

B) A local installation for the current user:
Open file .qmake.conf and set the installation directory as the value of variable LOCAL_INSTALL_DIR.
./configure
make
make install
B) A local installation for the current user:
Open file .qmake.conf and set the installation directory as the value of variable LOCAL_INSTALL_DIR.
Example: LOCAL_INSTALL_DIR="/home/termospullo/kactus2"

Now use the following commands in the given order:
./configure
make
make install

WARNING: If you run file configure with wrong Qt binaries, you will have to delete the generated
makefiles before configuring again!
WARNING: If you do ./configure with wrong Qt binaries, you will have to delete the generated
makefiles before configuring again!

There are three ways to run Kactus2:
3. There are three ways to run Kactus2:

A) An installation shared between users:
/usr/bin/Kactus2
A) An installation shared between users:
/usr/bin/Kactus2

B) A local installation from the installation directory:
LD_LIBRARY_PATH=. ./Kactus2
B) A local installation from the installation directory:
LD_LIBRARY_PATH=. ./Kactus2

C) In some systems, a link to the executable may appear if Kactus2 was installed for all users.
C) In some systems, a link to the executable may appear if Kactus2 was installed for all users.

Success reports
---------------

Tested on Ubuntu 16.04 64-bit on 20th Jun 2016
Tested on Ubuntu 16.04.1 64-bit on 1st Dec 2016
Locally installed Qt 5.7.0
Locally installed Kactus2 3.1.0
Locally installed Kactus2 3.2.283
Required installation of package libglu1-mesa-dev with admin privileges
Tested on Ubuntu 16.04 64-bit on 16th Jun 2016
Tested on Ubuntu 16.04.1 64-bit on 1st Dec 2016
Installed Qt 5.5.1 from packages
Installed Kactus2 3.0.193 for all users
Installed Kactus2 3.2.268 for all users

0 comments on commit d6b673b

Please sign in to comment.