Merge branch 'master' of https://github.com/mmicko/yosys into yosys-0.8-rc

This commit is contained in:
Clifford Wolf 2018-09-23 10:04:37 +02:00
commit 9659f7a99e
1 changed files with 11 additions and 11 deletions

View File

@ -33,22 +33,22 @@ dict<IdString, string> namecache;
int autoid_counter; int autoid_counter;
typedef unsigned FDirection; typedef unsigned FDirection;
static const FDirection NODIRECTION = 0x0; static const FDirection FD_NODIRECTION = 0x0;
static const FDirection IN = 0x1; static const FDirection FD_IN = 0x1;
static const FDirection OUT = 0x2; static const FDirection FD_OUT = 0x2;
static const FDirection INOUT = 0x3; static const FDirection FD_INOUT = 0x3;
// Get a port direction with respect to a specific module. // Get a port direction with respect to a specific module.
FDirection getPortFDirection(IdString id, Module *module) FDirection getPortFDirection(IdString id, Module *module)
{ {
Wire *wire = module->wires_.at(id); Wire *wire = module->wires_.at(id);
FDirection direction = NODIRECTION; FDirection direction = FD_NODIRECTION;
if (wire && wire->port_id) if (wire && wire->port_id)
{ {
if (wire->port_input) if (wire->port_input)
direction |= IN; direction |= FD_IN;
if (wire->port_output) if (wire->port_output)
direction |= OUT; direction |= FD_OUT;
} }
return direction; return direction;
} }
@ -193,16 +193,16 @@ struct FirrtlWorker
FDirection dir = getPortFDirection(it->first, instModule); FDirection dir = getPortFDirection(it->first, instModule);
std::string source, sink; std::string source, sink;
switch (dir) { switch (dir) {
case INOUT: case FD_INOUT:
log_warning("Instance port connection %s.%s is INOUT; treating as OUT\n", log_id(cell_type), log_signal(it->second)); log_warning("Instance port connection %s.%s is INOUT; treating as OUT\n", log_id(cell_type), log_signal(it->second));
case OUT: case FD_OUT:
source = firstName; source = firstName;
sink = secondName; sink = secondName;
break; break;
case NODIRECTION: case FD_NODIRECTION:
log_warning("Instance port connection %s.%s is NODIRECTION; treating as IN\n", log_id(cell_type), log_signal(it->second)); log_warning("Instance port connection %s.%s is NODIRECTION; treating as IN\n", log_id(cell_type), log_signal(it->second));
/* FALL_THROUGH */ /* FALL_THROUGH */
case IN: case FD_IN:
source = secondName; source = secondName;
sink = firstName; sink = firstName;
break; break;