Exemplo n.º 1
0
void Circuit::dumpCircuit()
{
    cout<<endl;
    cout<<"  Gate Name\tGate Level"<<endl;
    cout<<"========================================="<<endl;
    for( unsigned i = 0; i< numGate(); ++i )
    {
        Gate g = gate( i );
        cout<< "  " << g.name() << '\t' ;
        cout<< g.level() << '\t' ;
        //cout<< bitset<32>( value[i] ) <<'\t';
        cout<< endl;
    }

    cout<<endl;
    cout<<"  WireID\tWire Name\tType    \tValue"<<endl;
    cout<<"======================================================================================="<<endl;
    for( unsigned j = 0; j< numWire(); ++j )
    {
        Wire w = wire( j );
        cout<< "  "<< j << "\t\t";
        cout<< w.name() << "\t\t";
        cout<< setiosflags(ios::left) << setw(8) << w.type() <<'\t';
        if( w.type() != "UNUSED" )
            cout<< bitset<32>( w.valueSet() )<<'\t';
        else
            cout<<"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"<<'\t';
        cout<<endl;
    }
}