Deleted Added
sdiff udiff text old ( 11666:10d59d546ea2 ) new ( 11762:29d401db3746 )
full compact
1# Copyright (c) 2016 Georgia Institute of Technology
2# All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are
6# met: redistributions of source code must retain the above copyright
7# notice, this list of conditions and the following disclaimer;
8# redistributions in binary form must reproduce the above copyright

--- 56 unchanged lines hidden (view full) ---

65 help="""routing algorithm in network.
66 0: weight-based table
67 1: XY (for Mesh. see garnet2.0/RoutingUnit.cc)
68 2: Custom (see garnet2.0/RoutingUnit.cc""")
69 parser.add_option("--network-fault-model", action="store_true",
70 default=False,
71 help="""enable network fault model:
72 see src/mem/ruby/network/fault_model/""")
73
74
75def create_network(options, ruby):
76
77 # Set the network classes based on the command line options
78 if options.network == "garnet2.0":
79 NetworkClass = GarnetNetwork
80 IntLinkClass = GarnetIntLink

--- 17 unchanged lines hidden (view full) ---

98
99def init_network(options, network, InterfaceClass):
100
101 if options.network == "garnet2.0":
102 network.num_rows = options.mesh_rows
103 network.vcs_per_vnet = options.vcs_per_vnet
104 network.ni_flit_size = options.link_width_bits / 8
105 network.routing_algorithm = options.routing_algorithm
106
107 if options.network == "simple":
108 network.setup_buffers()
109
110 if InterfaceClass != None:
111 netifs = [InterfaceClass(id=i) \
112 for (i,n) in enumerate(network.ext_links)]
113 network.netifs = netifs
114
115 if options.network_fault_model:
116 assert(options.network == "garnet2.0")
117 network.enable_fault_model = True
118 network.fault_model = FaultModel()