Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: azonenberg/openfpga
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: a38304c196f2
Choose a base ref
...
head repository: azonenberg/openfpga
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: ab976c946b78
Choose a head ref
  • 2 commits
  • 4 files changed
  • 1 contributor

Commits on May 23, 2017

  1. Greenpak4Netlist: Removed "verbose" argument from IndexNets() because…

    … we now have LogTrace()
    azonenberg committed May 23, 2017
    Copy the full SHA
    0c82c38 View commit details
  2. Updated to latest logtools

    azonenberg committed May 23, 2017
    Copy the full SHA
    ab976c9 View commit details
Showing with 26 additions and 37 deletions.
  1. +2 −2 src/gp4par/make_graphs.cpp
  2. +20 −31 src/greenpak4/Greenpak4Netlist.cpp
  3. +3 −3 src/greenpak4/Greenpak4Netlist.h
  4. +1 −1 src/log
4 changes: 2 additions & 2 deletions src/gp4par/make_graphs.cpp
Original file line number Diff line number Diff line change
@@ -307,7 +307,7 @@ void InferExtraNodes(
if(madeChanges)
{
LogNotice("Re-indexing graph because we inferred additional nodes..\n");
netlist->Reindex(true);
netlist->Reindex();
ngraph->IndexNodesByLabel();
madeChanges = false;
}
@@ -358,7 +358,7 @@ void InferExtraNodes(
if(madeChanges)
{
LogVerbose("Re-indexing graph because we inferred additional nodes..\n");
netlist->Reindex(true);
netlist->Reindex();
ngraph->IndexNodesByLabel();
//madeChanges = false;
}
51 changes: 20 additions & 31 deletions src/greenpak4/Greenpak4Netlist.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/***********************************************************************************************************************
* Copyright (C) 2016 Andrew Zonenberg and contributors *
* Copyright (C) 2017 Andrew Zonenberg and contributors *
* *
* This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General *
* Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) *
@@ -216,7 +216,7 @@ void Greenpak4Netlist::Load(json_object* object)
}
}

IndexNets(true);
IndexNets();
}

/**
@@ -236,10 +236,10 @@ void Greenpak4Netlist::ClearIndexes()
/**
@brief Force a re-index after changing the netlist (by PAR-level optimizations etc)
*/
void Greenpak4Netlist::Reindex(bool verbose)
void Greenpak4Netlist::Reindex()
{
ClearIndexes();
IndexNets(verbose);
IndexNets();
}

/**
@@ -248,27 +248,23 @@ void Greenpak4Netlist::Reindex(bool verbose)
Has to be done as a second pass because there may be cycles in the netlist preventing us from resolving names
as we parse the JSON
*/
void Greenpak4Netlist::IndexNets(bool verbose)
void Greenpak4Netlist::IndexNets()
{
if(verbose)
LogNotice("Indexing...\n");
LogTrace("Indexing...\n");

LogIndenter li;

//Loop over all of our ports and add them to the associated nets
for(auto it = m_topModule->port_begin(); it != m_topModule->port_end(); it ++)
{
Greenpak4NetlistPort* port = it->second;
if(verbose)
LogDebug("Port %s connects to:\n", it->first.c_str());
LogTrace("Port %s connects to:\n", it->first.c_str());
LogIndenter li;

for(unsigned int i=0; i<port->m_nodes.size(); i++)
{
auto x = port->m_nodes[i];

if(verbose)
LogDebug("bit %u: node %s\n", i, port->m_nodes[i]->m_name.c_str());
LogTrace("bit %u: node %s\n", i, port->m_nodes[i]->m_name.c_str());
x->m_ports.push_back(port);
}
}
@@ -277,8 +273,7 @@ void Greenpak4Netlist::IndexNets(bool verbose)
for(auto it = m_topModule->cell_begin(); it != m_topModule->cell_end(); it ++)
{
Greenpak4NetlistCell* cell = it->second;
if(verbose)
LogDebug("Cell %s connects to:\n", it->first.c_str());
LogTrace("Cell %s connects to:\n", it->first.c_str());
LogIndenter li;
for(auto jt : cell->m_connections)
{
@@ -290,13 +285,10 @@ void Greenpak4Netlist::IndexNets(bool verbose)
for(unsigned int i=0; i<net.size(); i++)
{
Greenpak4NetlistNode* node = net[i];
if(verbose)
{
if(vector)
LogDebug("%s[%u]: net %s\n", cellname.c_str(), i, node->m_name.c_str());
else
LogDebug("%s: net %s\n", cellname.c_str(), node->m_name.c_str());
}
if(vector)
LogTrace("%s[%u]: net %s\n", cellname.c_str(), i, node->m_name.c_str());
else
LogTrace("%s: net %s\n", cellname.c_str(), node->m_name.c_str());
node->m_nodeports.push_back(Greenpak4NetlistNodePoint(cell, cellname, i, vector));
}
}
@@ -311,17 +303,14 @@ void Greenpak4Netlist::IndexNets(bool verbose)
}

//Print them out
if(verbose)
for(auto node : m_nodes)
{
for(auto node : m_nodes)
{
LogDebug("Node %s connects to:\n", node->m_name.c_str());
LogIndenter li;
for(auto p : node->m_ports)
LogDebug("port %s\n", p->m_name.c_str());
for(auto c : node->m_nodeports)
LogDebug("cell %s port %s\n", c.m_cell->m_name.c_str(), c.m_portname.c_str());
}
LogTrace("Node %s connects to:\n", node->m_name.c_str());
LogIndenter li;
for(auto p : node->m_ports)
LogTrace("port %s\n", p->m_name.c_str());
for(auto c : node->m_nodeports)
LogTrace("cell %s port %s\n", c.m_cell->m_name.c_str(), c.m_portname.c_str());
}
}

6 changes: 3 additions & 3 deletions src/greenpak4/Greenpak4Netlist.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/***********************************************************************************************************************
* Copyright (C) 2016 Andrew Zonenberg and contributors *
* Copyright (C) 2017 Andrew Zonenberg and contributors *
* *
* This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General *
* Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) *
@@ -50,7 +50,7 @@ class Greenpak4Netlist
Greenpak4NetlistModule* GetModule(std::string name)
{ return m_modules[name]; }

void Reindex(bool verbose = true);
void Reindex();

//Returns true if we're good, false if parsing failed for some reason
bool Validate()
@@ -60,7 +60,7 @@ class Greenpak4Netlist

protected:

void IndexNets(bool verbose);
void IndexNets();
void ClearIndexes();

//Init helpers
2 changes: 1 addition & 1 deletion src/log
Submodule log updated from a0efde to 1bd2c2