PhotonicClos.cc revision 10447
110447Snilay@cs.wisc.edu#include "model/network/PhotonicClos.h"
210447Snilay@cs.wisc.edu
310447Snilay@cs.wisc.edu#include <cmath>
410447Snilay@cs.wisc.edu
510447Snilay@cs.wisc.edu#include "model/ModelGen.h"
610447Snilay@cs.wisc.edu#include "model/timing_graph/ElectricalTimingTree.h"
710447Snilay@cs.wisc.edu#include "model/timing_graph/ElectricalNet.h"
810447Snilay@cs.wisc.edu
910447Snilay@cs.wisc.edunamespace DSENT
1010447Snilay@cs.wisc.edu{
1110447Snilay@cs.wisc.edu    using std::sqrt;
1210447Snilay@cs.wisc.edu
1310447Snilay@cs.wisc.edu    PhotonicClos::PhotonicClos(const String& instance_name_, const TechModel* tech_model_)
1410447Snilay@cs.wisc.edu        : ElectricalModel(instance_name_, tech_model_)
1510447Snilay@cs.wisc.edu    {
1610447Snilay@cs.wisc.edu        initParameters();
1710447Snilay@cs.wisc.edu        initProperties();
1810447Snilay@cs.wisc.edu    }
1910447Snilay@cs.wisc.edu
2010447Snilay@cs.wisc.edu    PhotonicClos::~PhotonicClos()
2110447Snilay@cs.wisc.edu    {}
2210447Snilay@cs.wisc.edu
2310447Snilay@cs.wisc.edu    void PhotonicClos::initParameters()
2410447Snilay@cs.wisc.edu    {
2510447Snilay@cs.wisc.edu        // Clock Frequency
2610447Snilay@cs.wisc.edu        addParameterName("Frequency");
2710447Snilay@cs.wisc.edu        // Physical Parameters
2810447Snilay@cs.wisc.edu        addParameterName("NumberInputSites");
2910447Snilay@cs.wisc.edu        addParameterName("NumberOutputSites");
3010447Snilay@cs.wisc.edu        addParameterName("NumberBitsPerFlit");
3110447Snilay@cs.wisc.edu        // Number of each type of routers
3210447Snilay@cs.wisc.edu        addParameterName("NumberIngressRouters");
3310447Snilay@cs.wisc.edu        addParameterName("NumberMiddleRouters");
3410447Snilay@cs.wisc.edu        addParameterName("NumberEgressRouters");
3510447Snilay@cs.wisc.edu        // Optical link parameters
3610447Snilay@cs.wisc.edu        addParameterName("SWSR->LinkDataRate");
3710447Snilay@cs.wisc.edu        addParameterName("SWSR->LaserType");
3810447Snilay@cs.wisc.edu        addParameterName("SWSR->RingTuningMethod");
3910447Snilay@cs.wisc.edu        // Router parameters
4010447Snilay@cs.wisc.edu        addParameterName("Router->NumberVirtualNetworks");
4110447Snilay@cs.wisc.edu        addParameterName("Router->NumberVirtualChannelsPerVirtualNetwork");
4210447Snilay@cs.wisc.edu        addParameterName("Router->NumberBuffersPerVirtualChannel");
4310447Snilay@cs.wisc.edu        addParameterName("Router->InputPort->BufferModel");
4410447Snilay@cs.wisc.edu        addParameterName("Router->CrossbarModel");
4510447Snilay@cs.wisc.edu        addParameterName("Router->SwitchAllocator->ArbiterModel");
4610447Snilay@cs.wisc.edu        addParameterName("Router->ClockTreeModel");
4710447Snilay@cs.wisc.edu        addParameterName("Router->ClockTree->NumberLevels");
4810447Snilay@cs.wisc.edu        addParameterName("Router->ClockTree->WireLayer");
4910447Snilay@cs.wisc.edu        addParameterName("Router->ClockTree->WireWidthMultiplier");
5010447Snilay@cs.wisc.edu        addParameterName("Router->ClockTree->WireSpacingMultiplier", 3.0);
5110447Snilay@cs.wisc.edu        // Link parameters
5210447Snilay@cs.wisc.edu        addParameterName("Link->WireLayer");
5310447Snilay@cs.wisc.edu        addParameterName("Link->WireWidthMultiplier");
5410447Snilay@cs.wisc.edu        addParameterName("Link->WireSpacingMultiplier");
5510447Snilay@cs.wisc.edu        return;
5610447Snilay@cs.wisc.edu    }
5710447Snilay@cs.wisc.edu
5810447Snilay@cs.wisc.edu    void PhotonicClos::initProperties()
5910447Snilay@cs.wisc.edu    {
6010447Snilay@cs.wisc.edu        addPropertyName("InputSitePitch");
6110447Snilay@cs.wisc.edu        addPropertyName("OutputSitePitch");
6210447Snilay@cs.wisc.edu		addPropertyName("SWSR->OptUtil", 1.0);
6310447Snilay@cs.wisc.edu        return;
6410447Snilay@cs.wisc.edu    }
6510447Snilay@cs.wisc.edu
6610447Snilay@cs.wisc.edu    PhotonicClos* PhotonicClos::clone() const
6710447Snilay@cs.wisc.edu    {
6810447Snilay@cs.wisc.edu        // TODO
6910447Snilay@cs.wisc.edu        return NULL;
7010447Snilay@cs.wisc.edu    }
7110447Snilay@cs.wisc.edu
7210447Snilay@cs.wisc.edu    void PhotonicClos::constructModel()
7310447Snilay@cs.wisc.edu    {
7410447Snilay@cs.wisc.edu        // Get input parameters
7510447Snilay@cs.wisc.edu        double clock_freq = getParameter("Frequency");
7610447Snilay@cs.wisc.edu        unsigned int number_input_sites = getParameter("NumberInputSites").toUInt();
7710447Snilay@cs.wisc.edu        unsigned int number_output_sites = getParameter("NumberOutputSites").toUInt();
7810447Snilay@cs.wisc.edu        unsigned int number_bits_per_flit = getParameter("NumberBitsPerFlit").toUInt();
7910447Snilay@cs.wisc.edu        unsigned int number_ingress_routers = getParameter("NumberIngressRouters").toUInt();
8010447Snilay@cs.wisc.edu        unsigned int number_middle_routers = getParameter("NumberMiddleRouters").toUInt();
8110447Snilay@cs.wisc.edu        unsigned int number_egress_routers = getParameter("NumberEgressRouters").toUInt();
8210447Snilay@cs.wisc.edu
8310447Snilay@cs.wisc.edu        ASSERT(clock_freq > 0, "[Error] " + getInstanceName() +
8410447Snilay@cs.wisc.edu                " -> Clock frequency must be > 0!");
8510447Snilay@cs.wisc.edu        ASSERT(number_input_sites > 0, "[Error] " + getInstanceName() +
8610447Snilay@cs.wisc.edu                " -> Number of input sites must be > 0!");
8710447Snilay@cs.wisc.edu        ASSERT(number_output_sites > 0, "[Error] " + getInstanceName() +
8810447Snilay@cs.wisc.edu                " -> Number of output sites must be > 0!");
8910447Snilay@cs.wisc.edu        ASSERT(number_bits_per_flit > 0, "[Error] " + getInstanceName() +
9010447Snilay@cs.wisc.edu                " -> Number of bits per flit must be > 0!");
9110447Snilay@cs.wisc.edu        ASSERT(number_ingress_routers > 0, "[Error] " + getInstanceName() +
9210447Snilay@cs.wisc.edu                " -> Number of ingress routers must be > 0!");
9310447Snilay@cs.wisc.edu        ASSERT(number_middle_routers > 0, "[Error] " + getInstanceName() +
9410447Snilay@cs.wisc.edu                " -> Number of middle routers must be > 0!");
9510447Snilay@cs.wisc.edu        ASSERT(number_egress_routers > 0, "[Error] " + getInstanceName() +
9610447Snilay@cs.wisc.edu                " -> Number of egress routers must be > 0!");
9710447Snilay@cs.wisc.edu
9810447Snilay@cs.wisc.edu        // Get input parameters that will be forwarded to the sub instances
9910447Snilay@cs.wisc.edu        const String& swsr_link_data_rate = getParameter("SWSR->LinkDataRate");
10010447Snilay@cs.wisc.edu        const String& swsr_laser_type = getParameter("SWSR->LaserType");
10110447Snilay@cs.wisc.edu        const String& swsr_ring_tuning_method = getParameter("SWSR->RingTuningMethod");
10210447Snilay@cs.wisc.edu        const String& router_number_vns = getParameter("Router->NumberVirtualNetworks");
10310447Snilay@cs.wisc.edu        const String& router_number_vcs_per_vn = getParameter("Router->NumberVirtualChannelsPerVirtualNetwork");
10410447Snilay@cs.wisc.edu        const String& router_number_bufs_per_vc = getParameter("Router->NumberBuffersPerVirtualChannel");
10510447Snilay@cs.wisc.edu        const String& router_buffer_model = getParameter("Router->InputPort->BufferModel");
10610447Snilay@cs.wisc.edu        const String& router_crossbar_model = getParameter("Router->CrossbarModel");
10710447Snilay@cs.wisc.edu        const String& link_wire_layer = getParameter("Link->WireLayer");
10810447Snilay@cs.wisc.edu        const String& link_wire_width_multiplier = getParameter("Link->WireWidthMultiplier");
10910447Snilay@cs.wisc.edu        const String& link_wire_spacing_multiplier = getParameter("Link->WireSpacingMultiplier");
11010447Snilay@cs.wisc.edu
11110447Snilay@cs.wisc.edu        // Calculate properties from input parameters
11210447Snilay@cs.wisc.edu        unsigned int ingress_router_number_input_ports = number_input_sites / number_ingress_routers;
11310447Snilay@cs.wisc.edu        unsigned int ingress_router_number_output_ports = number_middle_routers;
11410447Snilay@cs.wisc.edu        unsigned int middle_router_number_input_ports = number_ingress_routers;
11510447Snilay@cs.wisc.edu        unsigned int middle_router_number_output_ports = number_egress_routers;
11610447Snilay@cs.wisc.edu        unsigned int egress_router_number_input_ports = number_middle_routers;
11710447Snilay@cs.wisc.edu        unsigned int egress_router_number_output_ports = number_output_sites / number_egress_routers;
11810447Snilay@cs.wisc.edu        unsigned int number_input_to_ingress_links = number_input_sites;
11910447Snilay@cs.wisc.edu        unsigned int number_ingress_to_middle_links = number_ingress_routers * number_middle_routers;
12010447Snilay@cs.wisc.edu        unsigned int number_middle_to_egress_links = number_middle_routers * number_egress_routers;
12110447Snilay@cs.wisc.edu        unsigned int number_egress_to_output_links = number_output_sites;
12210447Snilay@cs.wisc.edu
12310447Snilay@cs.wisc.edu        getGenProperties()->set("NumberInputSitesPerIngressRouter", ingress_router_number_input_ports);
12410447Snilay@cs.wisc.edu        getGenProperties()->set("NumberOutputSitesPerEgressRouter", egress_router_number_output_ports);
12510447Snilay@cs.wisc.edu        getGenProperties()->set("IngressRouter->NumberInputPorts", ingress_router_number_input_ports);
12610447Snilay@cs.wisc.edu        getGenProperties()->set("IngressRouter->NumberOutputPorts", ingress_router_number_output_ports);
12710447Snilay@cs.wisc.edu        getGenProperties()->set("MiddleRouter->NumberInputPorts", middle_router_number_input_ports);
12810447Snilay@cs.wisc.edu        getGenProperties()->set("MiddleRouter->NumberOutputPorts", middle_router_number_output_ports);
12910447Snilay@cs.wisc.edu        getGenProperties()->set("EgressRouter->NumberInputPorts", egress_router_number_input_ports);
13010447Snilay@cs.wisc.edu        getGenProperties()->set("EgressRouter->NumberOutputPorts", egress_router_number_output_ports);
13110447Snilay@cs.wisc.edu
13210447Snilay@cs.wisc.edu        // Create ports
13310447Snilay@cs.wisc.edu        createInputPort("CK");
13410447Snilay@cs.wisc.edu
13510447Snilay@cs.wisc.edu        // Init ingress router
13610447Snilay@cs.wisc.edu        ElectricalModel* ingress_router = (ElectricalModel*)ModelGen::createModel("Router", "IngressRouter", getTechModel());
13710447Snilay@cs.wisc.edu        ingress_router->setParameter("NumberInputPorts", ingress_router_number_input_ports);
13810447Snilay@cs.wisc.edu        ingress_router->setParameter("NumberOutputPorts", ingress_router_number_output_ports);
13910447Snilay@cs.wisc.edu        ingress_router->setParameter("NumberVirtualNetworks", router_number_vns);
14010447Snilay@cs.wisc.edu        ingress_router->setParameter("NumberVirtualChannelsPerVirtualNetwork", router_number_vcs_per_vn);
14110447Snilay@cs.wisc.edu        ingress_router->setParameter("NumberBuffersPerVirtualChannel", router_number_bufs_per_vc);
14210447Snilay@cs.wisc.edu        ingress_router->setParameter("NumberBitsPerFlit", number_bits_per_flit);
14310447Snilay@cs.wisc.edu        ingress_router->setParameter("InputPort->BufferModel", router_buffer_model);
14410447Snilay@cs.wisc.edu        ingress_router->setParameter("CrossbarModel", router_crossbar_model);
14510447Snilay@cs.wisc.edu        ingress_router->setParameter("SwitchAllocator->ArbiterModel", getParameter("Router->SwitchAllocator->ArbiterModel"));
14610447Snilay@cs.wisc.edu        ingress_router->setParameter("ClockTreeModel", getParameter("Router->ClockTreeModel"));
14710447Snilay@cs.wisc.edu        ingress_router->setParameter("ClockTree->NumberLevels", getParameter("Router->ClockTree->NumberLevels"));
14810447Snilay@cs.wisc.edu        ingress_router->setParameter("ClockTree->WireLayer", getParameter("Router->ClockTree->WireLayer"));
14910447Snilay@cs.wisc.edu        ingress_router->setParameter("ClockTree->WireWidthMultiplier", getParameter("Router->ClockTree->WireWidthMultiplier"));
15010447Snilay@cs.wisc.edu        ingress_router->setParameter("ClockTree->WireSpacingMultiplier", getParameter("Router->ClockTree->WireSpacingMultiplier"));
15110447Snilay@cs.wisc.edu        ingress_router->construct();
15210447Snilay@cs.wisc.edu        // Init middle routers
15310447Snilay@cs.wisc.edu        ElectricalModel* middle_router = (ElectricalModel*)ModelGen::createModel("Router", "MiddleRouter", getTechModel());
15410447Snilay@cs.wisc.edu        middle_router->setParameter("NumberInputPorts", middle_router_number_input_ports);
15510447Snilay@cs.wisc.edu        middle_router->setParameter("NumberOutputPorts", middle_router_number_output_ports);
15610447Snilay@cs.wisc.edu        middle_router->setParameter("NumberVirtualNetworks", router_number_vns);
15710447Snilay@cs.wisc.edu        middle_router->setParameter("NumberVirtualChannelsPerVirtualNetwork", router_number_vcs_per_vn);
15810447Snilay@cs.wisc.edu        middle_router->setParameter("NumberBuffersPerVirtualChannel", router_number_bufs_per_vc);
15910447Snilay@cs.wisc.edu        middle_router->setParameter("NumberBitsPerFlit", number_bits_per_flit);
16010447Snilay@cs.wisc.edu        middle_router->setParameter("InputPort->BufferModel", router_buffer_model);
16110447Snilay@cs.wisc.edu        middle_router->setParameter("CrossbarModel", router_crossbar_model);
16210447Snilay@cs.wisc.edu        middle_router->setParameter("SwitchAllocator->ArbiterModel", getParameter("Router->SwitchAllocator->ArbiterModel"));
16310447Snilay@cs.wisc.edu        middle_router->setParameter("ClockTreeModel", getParameter("Router->ClockTreeModel"));
16410447Snilay@cs.wisc.edu        middle_router->setParameter("ClockTree->NumberLevels", getParameter("Router->ClockTree->NumberLevels"));
16510447Snilay@cs.wisc.edu        middle_router->setParameter("ClockTree->WireLayer", getParameter("Router->ClockTree->WireLayer"));
16610447Snilay@cs.wisc.edu        middle_router->setParameter("ClockTree->WireWidthMultiplier", getParameter("Router->ClockTree->WireWidthMultiplier"));
16710447Snilay@cs.wisc.edu        middle_router->setParameter("ClockTree->WireSpacingMultiplier", getParameter("Router->ClockTree->WireSpacingMultiplier"));
16810447Snilay@cs.wisc.edu        middle_router->construct();
16910447Snilay@cs.wisc.edu        // Init egress routers
17010447Snilay@cs.wisc.edu        ElectricalModel* egress_router = (ElectricalModel*)ModelGen::createModel("Router", "EgressRouter", getTechModel());
17110447Snilay@cs.wisc.edu        egress_router->setParameter("NumberInputPorts", egress_router_number_input_ports);
17210447Snilay@cs.wisc.edu        egress_router->setParameter("NumberOutputPorts", egress_router_number_output_ports);
17310447Snilay@cs.wisc.edu        egress_router->setParameter("NumberVirtualNetworks", router_number_vns);
17410447Snilay@cs.wisc.edu        egress_router->setParameter("NumberVirtualChannelsPerVirtualNetwork", router_number_vcs_per_vn);
17510447Snilay@cs.wisc.edu        egress_router->setParameter("NumberBuffersPerVirtualChannel", router_number_bufs_per_vc);
17610447Snilay@cs.wisc.edu        egress_router->setParameter("NumberBitsPerFlit", number_bits_per_flit);
17710447Snilay@cs.wisc.edu        egress_router->setParameter("InputPort->BufferModel", router_buffer_model);
17810447Snilay@cs.wisc.edu        egress_router->setParameter("CrossbarModel", router_crossbar_model);
17910447Snilay@cs.wisc.edu        egress_router->setParameter("SwitchAllocator->ArbiterModel", getParameter("Router->SwitchAllocator->ArbiterModel"));
18010447Snilay@cs.wisc.edu        egress_router->setParameter("ClockTreeModel", getParameter("Router->ClockTreeModel"));
18110447Snilay@cs.wisc.edu        egress_router->setParameter("ClockTree->NumberLevels", getParameter("Router->ClockTree->NumberLevels"));
18210447Snilay@cs.wisc.edu        egress_router->setParameter("ClockTree->WireLayer", getParameter("Router->ClockTree->WireLayer"));
18310447Snilay@cs.wisc.edu        egress_router->setParameter("ClockTree->WireWidthMultiplier", getParameter("Router->ClockTree->WireWidthMultiplier"));
18410447Snilay@cs.wisc.edu        egress_router->setParameter("ClockTree->WireSpacingMultiplier", getParameter("Router->ClockTree->WireSpacingMultiplier"));
18510447Snilay@cs.wisc.edu        egress_router->construct();
18610447Snilay@cs.wisc.edu        // Init input to ingress link
18710447Snilay@cs.wisc.edu        ElectricalModel* input_to_ingress_link = (ElectricalModel*)ModelGen::createModel("RepeatedLink", "InputToIngressLink", getTechModel());
18810447Snilay@cs.wisc.edu        input_to_ingress_link->setParameter("NumberBits", number_bits_per_flit);
18910447Snilay@cs.wisc.edu        input_to_ingress_link->setParameter("WireLayer", link_wire_layer);
19010447Snilay@cs.wisc.edu        input_to_ingress_link->setParameter("WireWidthMultiplier", link_wire_width_multiplier);
19110447Snilay@cs.wisc.edu        input_to_ingress_link->setParameter("WireSpacingMultiplier", link_wire_spacing_multiplier);
19210447Snilay@cs.wisc.edu        input_to_ingress_link->construct();
19310447Snilay@cs.wisc.edu        // Init ingress to middle link
19410447Snilay@cs.wisc.edu        ElectricalModel* ingress_to_middle_link = (ElectricalModel*)ModelGen::createModel("SWSRLink", "IngressToMiddleLink", getTechModel());
19510447Snilay@cs.wisc.edu        ingress_to_middle_link->setParameter("NumberBits", number_bits_per_flit);
19610447Snilay@cs.wisc.edu        ingress_to_middle_link->setParameter("CoreDataRate", clock_freq);
19710447Snilay@cs.wisc.edu        ingress_to_middle_link->setParameter("LinkDataRate", swsr_link_data_rate);
19810447Snilay@cs.wisc.edu        ingress_to_middle_link->setParameter("LaserType", swsr_laser_type);
19910447Snilay@cs.wisc.edu        ingress_to_middle_link->setParameter("RingTuningMethod", swsr_ring_tuning_method);
20010447Snilay@cs.wisc.edu        ingress_to_middle_link->construct();
20110447Snilay@cs.wisc.edu        // Init middle to egress link
20210447Snilay@cs.wisc.edu        ElectricalModel* middle_to_egress_link = (ElectricalModel*)ModelGen::createModel("SWSRLink", "MiddleToEgressLink", getTechModel());
20310447Snilay@cs.wisc.edu        middle_to_egress_link->setParameter("NumberBits", number_bits_per_flit);
20410447Snilay@cs.wisc.edu        middle_to_egress_link->setParameter("CoreDataRate", clock_freq);
20510447Snilay@cs.wisc.edu        middle_to_egress_link->setParameter("LinkDataRate", swsr_link_data_rate);
20610447Snilay@cs.wisc.edu        middle_to_egress_link->setParameter("LaserType", swsr_laser_type);
20710447Snilay@cs.wisc.edu        middle_to_egress_link->setParameter("RingTuningMethod", swsr_ring_tuning_method);
20810447Snilay@cs.wisc.edu        middle_to_egress_link->construct();
20910447Snilay@cs.wisc.edu        // Init egress to output link
21010447Snilay@cs.wisc.edu        ElectricalModel* egress_to_output_link = (ElectricalModel*)ModelGen::createModel("RepeatedLink", "EgressToOutputLink", getTechModel());
21110447Snilay@cs.wisc.edu        egress_to_output_link->setParameter("NumberBits", number_bits_per_flit);
21210447Snilay@cs.wisc.edu        egress_to_output_link->setParameter("WireLayer", link_wire_layer);
21310447Snilay@cs.wisc.edu        egress_to_output_link->setParameter("WireWidthMultiplier", link_wire_width_multiplier);
21410447Snilay@cs.wisc.edu        egress_to_output_link->setParameter("WireSpacingMultiplier", link_wire_spacing_multiplier);
21510447Snilay@cs.wisc.edu        egress_to_output_link->construct();
21610447Snilay@cs.wisc.edu
21710447Snilay@cs.wisc.edu        // Connect ports
21810447Snilay@cs.wisc.edu        createNet("InputToIngressLink_Out", makeNetIndex(0, number_bits_per_flit - 1));
21910447Snilay@cs.wisc.edu        createNet("InputToIngressLink_In", makeNetIndex(0, number_bits_per_flit - 1));
22010447Snilay@cs.wisc.edu        portConnect(input_to_ingress_link, "In", "InputToIngressLink_In");
22110447Snilay@cs.wisc.edu        portConnect(input_to_ingress_link, "Out", "InputToIngressLink_Out");
22210447Snilay@cs.wisc.edu
22310447Snilay@cs.wisc.edu        createNet("IngressToMiddleLink_In", makeNetIndex(0, number_bits_per_flit - 1));
22410447Snilay@cs.wisc.edu        createNet("IngressToMiddleLink_Out", makeNetIndex(0, number_bits_per_flit - 1));
22510447Snilay@cs.wisc.edu        portConnect(ingress_to_middle_link, "In", "IngressToMiddleLink_In");
22610447Snilay@cs.wisc.edu        portConnect(ingress_to_middle_link, "Out", "IngressToMiddleLink_Out");
22710447Snilay@cs.wisc.edu
22810447Snilay@cs.wisc.edu        createNet("MiddleToEgressLink_In", makeNetIndex(0, number_bits_per_flit - 1));
22910447Snilay@cs.wisc.edu        createNet("MiddleToEgressLink_Out", makeNetIndex(0, number_bits_per_flit - 1));
23010447Snilay@cs.wisc.edu        portConnect(middle_to_egress_link, "In", "MiddleToEgressLink_In");
23110447Snilay@cs.wisc.edu        portConnect(middle_to_egress_link, "Out", "MiddleToEgressLink_Out");
23210447Snilay@cs.wisc.edu
23310447Snilay@cs.wisc.edu        createNet("EgressToOutputLink_In", makeNetIndex(0, number_bits_per_flit - 1));
23410447Snilay@cs.wisc.edu        createNet("EgressToOutputLink_Out", makeNetIndex(0, number_bits_per_flit - 1));
23510447Snilay@cs.wisc.edu        portConnect(egress_to_output_link, "In", "EgressToOutputLink_In");
23610447Snilay@cs.wisc.edu        portConnect(egress_to_output_link, "Out", "EgressToOutputLink_Out");
23710447Snilay@cs.wisc.edu
23810447Snilay@cs.wisc.edu        portConnect(ingress_router, "CK", "CK");
23910447Snilay@cs.wisc.edu        for(unsigned int i = 0; i < ingress_router_number_input_ports; ++i)
24010447Snilay@cs.wisc.edu        {
24110447Snilay@cs.wisc.edu            createNet("IngressRouter_In" + (String)i, makeNetIndex(0, number_bits_per_flit-1));
24210447Snilay@cs.wisc.edu            for (unsigned int j = 0; j < number_bits_per_flit; ++j)
24310447Snilay@cs.wisc.edu                assignVirtualFanout("IngressRouter_In" + (String)i, makeNetIndex(j), "InputToIngressLink_Out", makeNetIndex(j));
24410447Snilay@cs.wisc.edu            portConnect(ingress_router, "FlitIn" + (String)i, "IngressRouter_In" + (String)i);
24510447Snilay@cs.wisc.edu        }
24610447Snilay@cs.wisc.edu        for(unsigned int i = 0; i < ingress_router_number_output_ports; ++i)
24710447Snilay@cs.wisc.edu        {
24810447Snilay@cs.wisc.edu            // VFI
24910447Snilay@cs.wisc.edu            portConnect(ingress_router, "FlitOut" + (String)i, "IngressToMiddleLink_In");
25010447Snilay@cs.wisc.edu        }
25110447Snilay@cs.wisc.edu        portConnect(middle_router, "CK", "CK");
25210447Snilay@cs.wisc.edu        for(unsigned int i = 0; i < middle_router_number_input_ports; ++i)
25310447Snilay@cs.wisc.edu        {
25410447Snilay@cs.wisc.edu            createNet("MiddleRouter_In" + (String)i, makeNetIndex(0, number_bits_per_flit-1));
25510447Snilay@cs.wisc.edu            for (unsigned int j = 0; j < number_bits_per_flit; ++j)
25610447Snilay@cs.wisc.edu                assignVirtualFanout("MiddleRouter_In" + (String)i, makeNetIndex(j), "IngressToMiddleLink_Out", makeNetIndex(j));
25710447Snilay@cs.wisc.edu            portConnect(middle_router, "FlitIn" + (String)i, "MiddleRouter_In" + (String)i);
25810447Snilay@cs.wisc.edu        }
25910447Snilay@cs.wisc.edu        for(unsigned int i = 0; i < middle_router_number_output_ports; ++i)
26010447Snilay@cs.wisc.edu        {
26110447Snilay@cs.wisc.edu            // VFI
26210447Snilay@cs.wisc.edu            portConnect(middle_router, "FlitOut" + (String)i, "MiddleToEgressLink_In");
26310447Snilay@cs.wisc.edu        }
26410447Snilay@cs.wisc.edu        portConnect(egress_router, "CK", "CK");
26510447Snilay@cs.wisc.edu        for(unsigned int i = 0; i < egress_router_number_input_ports; ++i)
26610447Snilay@cs.wisc.edu        {
26710447Snilay@cs.wisc.edu            createNet("EgressRouter_In" + (String)i, makeNetIndex(0, number_bits_per_flit-1));
26810447Snilay@cs.wisc.edu            for (unsigned int j = 0; j < number_bits_per_flit; ++j)
26910447Snilay@cs.wisc.edu                assignVirtualFanout("EgressRouter_In" + (String)i, makeNetIndex(j), "MiddleToEgressLink_Out", makeNetIndex(j));
27010447Snilay@cs.wisc.edu            portConnect(egress_router, "FlitIn" + (String)i, "EgressRouter_In" + (String)i);
27110447Snilay@cs.wisc.edu        }
27210447Snilay@cs.wisc.edu        for(unsigned int i = 0; i < egress_router_number_output_ports; ++i)
27310447Snilay@cs.wisc.edu        {
27410447Snilay@cs.wisc.edu            // VFI
27510447Snilay@cs.wisc.edu            portConnect(egress_router, "FlitOut" + (String)i, "EgressToOutputLink_In");
27610447Snilay@cs.wisc.edu        }
27710447Snilay@cs.wisc.edu
27810447Snilay@cs.wisc.edu        // Create area, power, and event results
27910447Snilay@cs.wisc.edu        createElectricalResults();
28010447Snilay@cs.wisc.edu        createElectricalEventResult("AvgUnicast");
28110447Snilay@cs.wisc.edu        createElectricalEventResult("AvgBroadcast");
28210447Snilay@cs.wisc.edu        addNddPowerResult(new Result("Laser"));
28310447Snilay@cs.wisc.edu        addNddPowerResult(new Result("RingTuning"));
28410447Snilay@cs.wisc.edu        addAreaResult(new Result("Photonic"));
28510447Snilay@cs.wisc.edu
28610447Snilay@cs.wisc.edu        // Add all instances
28710447Snilay@cs.wisc.edu        addSubInstances(ingress_router, number_ingress_routers);
28810447Snilay@cs.wisc.edu        addElectricalSubResults(ingress_router, number_ingress_routers);
28910447Snilay@cs.wisc.edu        addSubInstances(middle_router, number_middle_routers);
29010447Snilay@cs.wisc.edu        addElectricalSubResults(middle_router, number_middle_routers);
29110447Snilay@cs.wisc.edu        addSubInstances(egress_router, number_egress_routers);
29210447Snilay@cs.wisc.edu        addElectricalSubResults(egress_router, number_egress_routers);
29310447Snilay@cs.wisc.edu        addSubInstances(input_to_ingress_link, number_input_to_ingress_links);
29410447Snilay@cs.wisc.edu        addElectricalSubResults(input_to_ingress_link, number_input_to_ingress_links);
29510447Snilay@cs.wisc.edu        addSubInstances(ingress_to_middle_link, number_ingress_to_middle_links);
29610447Snilay@cs.wisc.edu        addElectricalSubResults(ingress_to_middle_link, number_ingress_to_middle_links);
29710447Snilay@cs.wisc.edu        getAreaResult("Photonic")->addSubResult(ingress_to_middle_link->getAreaResult("Photonic"), "IngressToMiddleLink", number_ingress_to_middle_links);
29810447Snilay@cs.wisc.edu        getNddPowerResult("Laser")->addSubResult(ingress_to_middle_link->getNddPowerResult("Laser"), "IngressToMiddleLink", number_ingress_to_middle_links);
29910447Snilay@cs.wisc.edu        getNddPowerResult("RingTuning")->addSubResult(ingress_to_middle_link->getNddPowerResult("RingTuning"), "IngressToMiddleLink", number_ingress_to_middle_links);
30010447Snilay@cs.wisc.edu        addSubInstances(middle_to_egress_link, number_middle_to_egress_links);
30110447Snilay@cs.wisc.edu        addElectricalSubResults(middle_to_egress_link, number_middle_to_egress_links);
30210447Snilay@cs.wisc.edu        getAreaResult("Photonic")->addSubResult(middle_to_egress_link->getAreaResult("Photonic"), "MiddletoEgressLink", number_middle_to_egress_links);
30310447Snilay@cs.wisc.edu        getNddPowerResult("Laser")->addSubResult(middle_to_egress_link->getNddPowerResult("Laser"), "MiddleToEgressLink", number_middle_to_egress_links);
30410447Snilay@cs.wisc.edu        getNddPowerResult("RingTuning")->addSubResult(middle_to_egress_link->getNddPowerResult("RingTuning"), "MiddleToEgressLink", number_middle_to_egress_links);
30510447Snilay@cs.wisc.edu        addSubInstances(egress_to_output_link, number_egress_to_output_links);
30610447Snilay@cs.wisc.edu        addElectricalSubResults(egress_to_output_link, number_egress_to_output_links);
30710447Snilay@cs.wisc.edu
30810447Snilay@cs.wisc.edu        // Update unicast event
30910447Snilay@cs.wisc.edu        Result* avg_unicast_event = getEventResult("AvgUnicast");
31010447Snilay@cs.wisc.edu        avg_unicast_event->addSubResult(input_to_ingress_link->getEventResult("Send"), "InputToIngressLink", 1.0);
31110447Snilay@cs.wisc.edu        if(ingress_router->hasEventResult("WriteBuffer"))
31210447Snilay@cs.wisc.edu        {
31310447Snilay@cs.wisc.edu            avg_unicast_event->addSubResult(ingress_router->getEventResult("WriteBuffer"), "IngressRouter", 1.0);
31410447Snilay@cs.wisc.edu        }
31510447Snilay@cs.wisc.edu        if(ingress_router->hasEventResult("ReadBuffer"))
31610447Snilay@cs.wisc.edu        {
31710447Snilay@cs.wisc.edu            avg_unicast_event->addSubResult(ingress_router->getEventResult("ReadBuffer"), "IngressRouter", 1.0);
31810447Snilay@cs.wisc.edu        }
31910447Snilay@cs.wisc.edu        avg_unicast_event->addSubResult(ingress_router->getEventResult("TraverseCrossbar->Multicast1"), "IngressRouter", 1.0);
32010447Snilay@cs.wisc.edu        avg_unicast_event->addSubResult(ingress_to_middle_link->getEventResult("Send"), "IngressToMiddleLink", 1.0);
32110447Snilay@cs.wisc.edu        if(middle_router->hasEventResult("WriteBuffer"))
32210447Snilay@cs.wisc.edu        {
32310447Snilay@cs.wisc.edu            avg_unicast_event->addSubResult(middle_router->getEventResult("WriteBuffer"), "MiddleRouter", 1.0);
32410447Snilay@cs.wisc.edu        }
32510447Snilay@cs.wisc.edu        if(middle_router->hasEventResult("ReadBuffer"))
32610447Snilay@cs.wisc.edu        {
32710447Snilay@cs.wisc.edu            avg_unicast_event->addSubResult(middle_router->getEventResult("ReadBuffer"), "MiddleRouter", 1.0);
32810447Snilay@cs.wisc.edu        }
32910447Snilay@cs.wisc.edu        avg_unicast_event->addSubResult(middle_router->getEventResult("TraverseCrossbar->Multicast1"), "MiddleRouter", 1.0);
33010447Snilay@cs.wisc.edu        avg_unicast_event->addSubResult(middle_to_egress_link->getEventResult("Send"), "MiddleToEgressLink", 1.0);
33110447Snilay@cs.wisc.edu        if(egress_router->hasEventResult("WriteBuffer"))
33210447Snilay@cs.wisc.edu        {
33310447Snilay@cs.wisc.edu            avg_unicast_event->addSubResult(egress_router->getEventResult("WriteBuffer"), "EgressRouter", 1.0);
33410447Snilay@cs.wisc.edu        }
33510447Snilay@cs.wisc.edu        if(egress_router->hasEventResult("ReadBuffer"))
33610447Snilay@cs.wisc.edu        {
33710447Snilay@cs.wisc.edu            avg_unicast_event->addSubResult(egress_router->getEventResult("ReadBuffer"), "EgressRouter", 1.0);
33810447Snilay@cs.wisc.edu        }
33910447Snilay@cs.wisc.edu        avg_unicast_event->addSubResult(egress_router->getEventResult("TraverseCrossbar->Multicast1"), "EgressRouter", 1.0);
34010447Snilay@cs.wisc.edu        avg_unicast_event->addSubResult(egress_to_output_link->getEventResult("Send"), "EgressToOutputLink", 1.0);
34110447Snilay@cs.wisc.edu
34210447Snilay@cs.wisc.edu        // Update broadcast event
34310447Snilay@cs.wisc.edu        Result* avg_broadcast_event = getEventResult("AvgBroadcast");
34410447Snilay@cs.wisc.edu        avg_broadcast_event->addSubResult(input_to_ingress_link->getEventResult("Send"), "InputToIngressLink", 1.0);
34510447Snilay@cs.wisc.edu        if(ingress_router->hasEventResult("WriteBuffer"))
34610447Snilay@cs.wisc.edu        {
34710447Snilay@cs.wisc.edu            avg_broadcast_event->addSubResult(ingress_router->getEventResult("WriteBuffer"), "IngressRouter", 1.0);
34810447Snilay@cs.wisc.edu        }
34910447Snilay@cs.wisc.edu        if(ingress_router->hasEventResult("ReadBuffer"))
35010447Snilay@cs.wisc.edu        {
35110447Snilay@cs.wisc.edu            avg_broadcast_event->addSubResult(ingress_router->getEventResult("ReadBuffer"), "IngressRouter", 1.0);
35210447Snilay@cs.wisc.edu        }
35310447Snilay@cs.wisc.edu        avg_broadcast_event->addSubResult(ingress_router->getEventResult("TraverseCrossbar->Multicast1"), "IngressRouter", 1.0);
35410447Snilay@cs.wisc.edu        avg_broadcast_event->addSubResult(ingress_to_middle_link->getEventResult("Send"), "IngressToMiddleLink", 1.0);
35510447Snilay@cs.wisc.edu        if(middle_router->hasEventResult("WriteBuffer"))
35610447Snilay@cs.wisc.edu        {
35710447Snilay@cs.wisc.edu            avg_broadcast_event->addSubResult(middle_router->getEventResult("WriteBuffer"), "MiddleRouter", 1.0);
35810447Snilay@cs.wisc.edu        }
35910447Snilay@cs.wisc.edu        if(middle_router->hasEventResult("ReadBuffer"))
36010447Snilay@cs.wisc.edu        {
36110447Snilay@cs.wisc.edu            avg_broadcast_event->addSubResult(middle_router->getEventResult("ReadBuffer"), "MiddleRouter", 1.0);
36210447Snilay@cs.wisc.edu        }
36310447Snilay@cs.wisc.edu        avg_broadcast_event->addSubResult(middle_router->getEventResult("TraverseCrossbar->Multicast1"), "MiddleRouter", 1.0);
36410447Snilay@cs.wisc.edu        avg_broadcast_event->addSubResult(middle_to_egress_link->getEventResult("Send"), "MiddleToEgressLink", number_egress_routers);
36510447Snilay@cs.wisc.edu        if(egress_router->hasEventResult("WriteBuffer"))
36610447Snilay@cs.wisc.edu        {
36710447Snilay@cs.wisc.edu            avg_broadcast_event->addSubResult(egress_router->getEventResult("WriteBuffer"), "EgressRouter", number_egress_routers);
36810447Snilay@cs.wisc.edu        }
36910447Snilay@cs.wisc.edu        if(egress_router->hasEventResult("ReadBuffer"))
37010447Snilay@cs.wisc.edu        {
37110447Snilay@cs.wisc.edu            avg_broadcast_event->addSubResult(egress_router->getEventResult("ReadBuffer"), "EgressRouter", number_egress_routers);
37210447Snilay@cs.wisc.edu        }
37310447Snilay@cs.wisc.edu        avg_broadcast_event->addSubResult(egress_router->getEventResult("TraverseCrossbar->Multicast" + (String)number_egress_routers), "EgressRouter", 1.0);
37410447Snilay@cs.wisc.edu        avg_broadcast_event->addSubResult(egress_to_output_link->getEventResult("Send"), "EgressToOutputLink", number_output_sites);
37510447Snilay@cs.wisc.edu        return;
37610447Snilay@cs.wisc.edu    }
37710447Snilay@cs.wisc.edu
37810447Snilay@cs.wisc.edu    void PhotonicClos::updateModel()
37910447Snilay@cs.wisc.edu    {
38010447Snilay@cs.wisc.edu        // Assumes waveguide runs adjacent to ingress and egress routers
38110447Snilay@cs.wisc.edu        // Assumes input sites belonging to each ingress router are centered around the ingress router
38210447Snilay@cs.wisc.edu        // Assumes middle routers are distributed around the chip adjacent to the main waveguide
38310447Snilay@cs.wisc.edu        // Assumes output sites belonging to each egress router are centered around the egress router
38410447Snilay@cs.wisc.edu
38510447Snilay@cs.wisc.edu        // Get properties
38610447Snilay@cs.wisc.edu        double input_site_pitch = getProperty("InputSitePitch").toDouble();
38710447Snilay@cs.wisc.edu        double output_site_pitch = getProperty("OutputSitePitch").toDouble();
38810447Snilay@cs.wisc.edu        double clock_freq = getParameter("Frequency");
38910447Snilay@cs.wisc.edu		const double swsr_opt_util = getProperty("SWSR->OptUtil");
39010447Snilay@cs.wisc.edu
39110447Snilay@cs.wisc.edu        ASSERT(input_site_pitch > 0, "[Error] " + getInstanceName() +
39210447Snilay@cs.wisc.edu                " -> Input site pitch must be > 0!");
39310447Snilay@cs.wisc.edu        ASSERT(output_site_pitch > 0, "[Error] " + getInstanceName() +
39410447Snilay@cs.wisc.edu                " -> Output site pitch must be > 0!");
39510447Snilay@cs.wisc.edu
39610447Snilay@cs.wisc.edu        unsigned int number_input_sites_per_ingress_router = getGenProperties()->get("NumberInputSitesPerIngressRouter");
39710447Snilay@cs.wisc.edu        unsigned int number_ingress_routers = getParameter("NumberIngressRouters");
39810447Snilay@cs.wisc.edu        unsigned int number_output_sites_per_egress_router = getGenProperties()->get("NumberOutputSitesPerEgressRouter");
39910447Snilay@cs.wisc.edu        unsigned int number_egress_routers = getParameter("NumberEgressRouters");
40010447Snilay@cs.wisc.edu        double delay = 1.0 / clock_freq;
40110447Snilay@cs.wisc.edu
40210447Snilay@cs.wisc.edu        //Calculate the length of the waveguide
40310447Snilay@cs.wisc.edu        double input_to_ingress_link_length = input_site_pitch * (sqrt(number_input_sites_per_ingress_router) - 1.0);
40410447Snilay@cs.wisc.edu        double input_to_ingress_link_delay = delay * 0.8;
40510447Snilay@cs.wisc.edu        double ingress_to_middle_link_length = input_site_pitch * (sqrt(number_input_sites_per_ingress_router) * number_ingress_routers);
40610447Snilay@cs.wisc.edu        double middle_to_egress_link_length = output_site_pitch * (sqrt(number_output_sites_per_egress_router) * number_egress_routers);
40710447Snilay@cs.wisc.edu        double egress_to_output_link_length = output_site_pitch * (sqrt(number_output_sites_per_egress_router) - 1.0);
40810447Snilay@cs.wisc.edu        double egress_to_output_link_delay = delay * 0.8;
40910447Snilay@cs.wisc.edu        double ingress_router_delay = delay;
41010447Snilay@cs.wisc.edu        double middle_router_delay = delay;
41110447Snilay@cs.wisc.edu        double egress_router_delay = delay;
41210447Snilay@cs.wisc.edu
41310447Snilay@cs.wisc.edu        Model* input_to_ingress_link = getSubInstance("InputToIngressLink");
41410447Snilay@cs.wisc.edu        input_to_ingress_link->setProperty("WireLength", input_to_ingress_link_length);
41510447Snilay@cs.wisc.edu        input_to_ingress_link->setProperty("Delay", input_to_ingress_link_delay);
41610447Snilay@cs.wisc.edu        input_to_ingress_link->setProperty("IsKeepParity", "TRUE");
41710447Snilay@cs.wisc.edu        input_to_ingress_link->update();
41810447Snilay@cs.wisc.edu
41910447Snilay@cs.wisc.edu        Model* ingress_to_middle_link = getSubInstance("IngressToMiddleLink");
42010447Snilay@cs.wisc.edu        ingress_to_middle_link->setProperty("Length", ingress_to_middle_link_length);
42110447Snilay@cs.wisc.edu		ingress_to_middle_link->setProperty("OptUtil", swsr_opt_util);
42210447Snilay@cs.wisc.edu        ingress_to_middle_link->update();
42310447Snilay@cs.wisc.edu
42410447Snilay@cs.wisc.edu        Model* middle_to_egress_link = getSubInstance("MiddleToEgressLink");
42510447Snilay@cs.wisc.edu        middle_to_egress_link->setProperty("Length", middle_to_egress_link_length);
42610447Snilay@cs.wisc.edu		middle_to_egress_link->setProperty("OptUtil", swsr_opt_util);
42710447Snilay@cs.wisc.edu        middle_to_egress_link->update();
42810447Snilay@cs.wisc.edu
42910447Snilay@cs.wisc.edu        Model* egress_to_output_link = getSubInstance("EgressToOutputLink");
43010447Snilay@cs.wisc.edu        egress_to_output_link->setProperty("WireLength", egress_to_output_link_length);
43110447Snilay@cs.wisc.edu        egress_to_output_link->setProperty("Delay", egress_to_output_link_delay);
43210447Snilay@cs.wisc.edu        egress_to_output_link->setProperty("IsKeepParity", "TRUE");
43310447Snilay@cs.wisc.edu        egress_to_output_link->update();
43410447Snilay@cs.wisc.edu
43510447Snilay@cs.wisc.edu        ElectricalModel* ingress_router = (ElectricalModel*)getSubInstance("IngressRouter");
43610447Snilay@cs.wisc.edu        ingress_router->update();
43710447Snilay@cs.wisc.edu        ElectricalTimingTree ingress_router_timing_tree("IngressRouter", ingress_router);
43810447Snilay@cs.wisc.edu        ingress_router_timing_tree.performTimingOpt(ingress_router->getNet("CK"), ingress_router_delay);
43910447Snilay@cs.wisc.edu
44010447Snilay@cs.wisc.edu        ElectricalModel* middle_router = (ElectricalModel*)getSubInstance("MiddleRouter");
44110447Snilay@cs.wisc.edu        middle_router->update();
44210447Snilay@cs.wisc.edu        ElectricalTimingTree middle_router_timing_tree("MiddleRouter", middle_router);
44310447Snilay@cs.wisc.edu        middle_router_timing_tree.performTimingOpt(middle_router->getNet("CK"), middle_router_delay);
44410447Snilay@cs.wisc.edu
44510447Snilay@cs.wisc.edu        ElectricalModel* egress_router = (ElectricalModel*)getSubInstance("EgressRouter");
44610447Snilay@cs.wisc.edu        egress_router->update();
44710447Snilay@cs.wisc.edu        ElectricalTimingTree egress_router_timing_tree("EgressRouter", egress_router);
44810447Snilay@cs.wisc.edu        egress_router_timing_tree.performTimingOpt(egress_router->getNet("CK"), egress_router_delay);
44910447Snilay@cs.wisc.edu
45010447Snilay@cs.wisc.edu        return;
45110447Snilay@cs.wisc.edu    }
45210447Snilay@cs.wisc.edu
45310447Snilay@cs.wisc.edu    void PhotonicClos::propagateTransitionInfo()
45410447Snilay@cs.wisc.edu    {
45510447Snilay@cs.wisc.edu        // Get parameters
45610447Snilay@cs.wisc.edu        double clock_freq = getParameter("Frequency");
45710447Snilay@cs.wisc.edu        double swsr_link_data_rate = getParameter("SWSR->LinkDataRate");
45810447Snilay@cs.wisc.edu
45910447Snilay@cs.wisc.edu        // Get properties
46010447Snilay@cs.wisc.edu        unsigned int ingress_router_number_input_ports = getGenProperties()->get("IngressRouter->NumberInputPorts");
46110447Snilay@cs.wisc.edu        unsigned int middle_router_number_input_ports = getGenProperties()->get("MiddleRouter->NumberInputPorts");
46210447Snilay@cs.wisc.edu        unsigned int egress_router_number_input_ports = getGenProperties()->get("EgressRouter->NumberInputPorts");
46310447Snilay@cs.wisc.edu
46410447Snilay@cs.wisc.edu        ElectricalModel* input_to_ingress_link = (ElectricalModel*)getSubInstance("InputToIngressLink");
46510447Snilay@cs.wisc.edu        assignPortTransitionInfo(input_to_ingress_link, "In", TransitionInfo(0.25, 0.25, 0.25));
46610447Snilay@cs.wisc.edu        input_to_ingress_link->use();
46710447Snilay@cs.wisc.edu
46810447Snilay@cs.wisc.edu        ElectricalModel* ingress_to_middle_link = (ElectricalModel*)getSubInstance("IngressToMiddleLink");
46910447Snilay@cs.wisc.edu        assignPortTransitionInfo(ingress_to_middle_link, "LinkCK", TransitionInfo(0.0, (double) clock_freq / (swsr_link_data_rate * 2.0), 0.0));
47010447Snilay@cs.wisc.edu        assignPortTransitionInfo(ingress_to_middle_link, "In", TransitionInfo(0.25, 0.25, 0.25));
47110447Snilay@cs.wisc.edu        ingress_to_middle_link->use();
47210447Snilay@cs.wisc.edu
47310447Snilay@cs.wisc.edu        ElectricalModel* middle_to_egress_link = (ElectricalModel*)getSubInstance("MiddleToEgressLink");
47410447Snilay@cs.wisc.edu        assignPortTransitionInfo(middle_to_egress_link, "LinkCK", TransitionInfo(0.0, (double) clock_freq / (swsr_link_data_rate * 2.0), 0.0));
47510447Snilay@cs.wisc.edu        assignPortTransitionInfo(middle_to_egress_link, "In", TransitionInfo(0.25, 0.25, 0.25));
47610447Snilay@cs.wisc.edu        middle_to_egress_link->use();
47710447Snilay@cs.wisc.edu
47810447Snilay@cs.wisc.edu        ElectricalModel* egress_to_output_link = (ElectricalModel*)getSubInstance("EgressToOutputLink");
47910447Snilay@cs.wisc.edu        assignPortTransitionInfo(egress_to_output_link, "In", TransitionInfo(0.25, 0.25, 0.25));
48010447Snilay@cs.wisc.edu        egress_to_output_link->use();
48110447Snilay@cs.wisc.edu
48210447Snilay@cs.wisc.edu        ElectricalModel* ingress_router = (ElectricalModel*)getSubInstance("IngressRouter");
48310447Snilay@cs.wisc.edu        for(unsigned int i = 0; i < ingress_router_number_input_ports; ++i)
48410447Snilay@cs.wisc.edu        {
48510447Snilay@cs.wisc.edu            assignPortTransitionInfo(ingress_router, "FlitIn" + (String)i, TransitionInfo(0.25, 0.25, 0.25));
48610447Snilay@cs.wisc.edu        }
48710447Snilay@cs.wisc.edu        assignPortTransitionInfo(ingress_router, "CK", TransitionInfo(0.0, 1.0, 0.0));
48810447Snilay@cs.wisc.edu        ingress_router->getGenProperties()->set("UseModelEvent", "");
48910447Snilay@cs.wisc.edu        ingress_router->use();
49010447Snilay@cs.wisc.edu
49110447Snilay@cs.wisc.edu        ElectricalModel* middle_router = (ElectricalModel*)getSubInstance("MiddleRouter");
49210447Snilay@cs.wisc.edu        for(unsigned int i = 0; i < middle_router_number_input_ports; ++i)
49310447Snilay@cs.wisc.edu        {
49410447Snilay@cs.wisc.edu            assignPortTransitionInfo(middle_router, "FlitIn" + (String)i, TransitionInfo(0.25, 0.25, 0.25));
49510447Snilay@cs.wisc.edu        }
49610447Snilay@cs.wisc.edu        assignPortTransitionInfo(middle_router, "CK", TransitionInfo(0.0, 1.0, 0.0));
49710447Snilay@cs.wisc.edu        middle_router->getGenProperties()->set("UseModelEvent", "");
49810447Snilay@cs.wisc.edu        middle_router->use();
49910447Snilay@cs.wisc.edu
50010447Snilay@cs.wisc.edu        ElectricalModel* egress_router = (ElectricalModel*)getSubInstance("EgressRouter");
50110447Snilay@cs.wisc.edu        for(unsigned int i = 0; i < egress_router_number_input_ports; ++i)
50210447Snilay@cs.wisc.edu        {
50310447Snilay@cs.wisc.edu            assignPortTransitionInfo(egress_router, "FlitIn" + (String)i, TransitionInfo(0.25, 0.25, 0.25));
50410447Snilay@cs.wisc.edu        }
50510447Snilay@cs.wisc.edu        assignPortTransitionInfo(egress_router, "CK", TransitionInfo(0.0, 1.0, 0.0));
50610447Snilay@cs.wisc.edu        egress_router->getGenProperties()->set("UseModelEvent", "");
50710447Snilay@cs.wisc.edu        egress_router->use();
50810447Snilay@cs.wisc.edu
50910447Snilay@cs.wisc.edu        return;
51010447Snilay@cs.wisc.edu    }
51110447Snilay@cs.wisc.edu} // namespace DSENT
51210447Snilay@cs.wisc.edu
513