# Checking Assertion
assert(options.num_rows <= options.num_cpus)
assert(options.num_cpus == options.num_rows*num_routers)
# Create the mesh object
*clovertown = Clovertown()*
# Create a router for each package.
clovertown.routers = [Router(router_id=i) for i in range(num_packs))]
# link counter to set unique link ids
link_count = 0
On Tue, Jan 3, 2012 at 4:58 PM, Mahmood Naderan <[email protected]>wrote:
> please paste line 49 (with some line before and after) exactly from your
> file
>
> On 1/3/12, Hamid Reza Khaleghzadeh <[email protected]> wrote:
> > I do it, but there is still the problem.
> >
> > On Tue, Jan 3, 2012 at 4:48 PM, Mahmood Naderan <[email protected]
> >wrote:
> >
> >> After this line
> >> clover = Clovertown()
> >>
> >> ensure there is no <space>
> >>
> >> On 1/3/12, Hamid Reza Khaleghzadeh <[email protected]> wrote:
> >> > I have added my topology to Sconscript but when I want to recompile
> >> Gem5, I
> >> > have encountered with following Error:
> >> >
> >> > scons: ***
> [/home/hamidreza/build/ALPHA_FS/mem/ruby/network/topologies/
> >> > Clovertown.py.cc] IndentationError : unindent does not match any
> outer
> >> > indentation level (Clovertown.py, line 49)
> >> > Traceback (most recent call last):
> >> > File "/usr/lib/scons/SCons/Action.py", line 1046, in execute
> >> > result = self.execfunction(target=target, source=rsources,
> env=env)
> >> > File "/home/hamidreza/build/ALPHA_FS/SConscript", line 782, in
> >> embedPyFile
> >> > compiled = compile(src, pysource.abspath, 'exec')
> >> > File
> >> > "/home/hamidreza/gem5/src/mem/ruby/network/topologies/Clovertown.py",
> >> line
> >> > 49
> >> > clover = Clovertown()
> >> > ^
> >> > IndentationError: unindent does not match any outer indentation level
> >> > scons: building terminated because of errors.
> >> >
> >> > Could you help me?
> >> >
> >> > On Tue, Jan 3, 2012 at 3:28 PM, Nilay Vaish <[email protected]>
> wrote:
> >> >
> >> >> On Tue, 3 Jan 2012, Hamid Reza Khaleghzadeh wrote:
> >> >>
> >> >> Hello Gem5,
> >> >>>
> >> >>> I have implemented a network topology and then copy its python file
> >> into
> >> >>> "~/gem5/src/mem/ruby/network/**topologies/MyTopology.py". When gem5
> is
> >> >>> executed, I encounter with this error:
> >> >>>
> >> >>> ImportError: No module named MyTopology
> >> >>>
> >> >>> Could you help me?
> >> >>>
> >> >>> Thanks
> >> >>>
> >> >>>
> >> >> Two things that you may not have done --
> >> >> * add your topology to src/mem/ruby/network/**topologies/SConscript
> >> >> * recompile gem5
> >> >>
> >> >> --
> >> >> Nilay
> >> >> ______________________________**_________________
> >> >> gem5-users mailing list
> >> >> [email protected]
> >> >> http://m5sim.org/cgi-bin/**mailman/listinfo/gem5-users<
> >> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users>
> >> >>
> >> >
> >> >
> >> >
> >> > --
> >> > Hamid Reza Khaleghzadeh
> >> >
> >>
> >>
> >> --
> >> --
> >> // Naderan *Mahmood;
> >> _______________________________________________
> >> gem5-users mailing list
> >> [email protected]
> >> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
> >>
> >
> >
> >
> > --
> > Hamid Reza Khaleghzadeh
> >
>
>
> --
> --
> // Naderan *Mahmood;
> _______________________________________________
> gem5-users mailing list
> [email protected]
> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
>
--
Hamid Reza Khaleghzadeh
# Copyright (c) 2011 Advanced Micro Devices, Inc.
# 2011 Massachusetts Institute of Technology
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer;
# redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution;
# neither the name of the copyright holders nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Authors: Hamid Reza Khaleghzadeh
#
# num_rows = The number of nodes which exists in the each package.
from m5.params import *
from m5.objects import *
class Clovertown(Topology):
description='Clovertown'
def makeTopology(nodes, options, IntLink, ExtLink, Router):
num_packs = int(options.num_cpus / options.num_rows)
num_routers = int(options.num_cpus / options.package_size)
# Checking Assertion
assert(options.num_rows <= options.num_cpus)
assert(options.num_cpus == options.num_rows*num_routers)
# Create the mesh object
clovertown = Clovertown()
# Create a router for each package.
clovertown.routers = [Router(router_id=i) for i in range(num_packs))]
# link counter to set unique link ids
link_count = 0
# Connect each node to the appropriate router
ext_links = []
for (i, n) in enumerate(nodes):
cntrl_level, router_id = divmod(i, num_packs)
ext_links.append(ExtLink(link_id=link_count, ext_node=n,
int_node=clovertown.routers[router_id]))
link_count += 1
# Create the clovertown links.
int_links = []
for item in xrange(num_packs):
val1,val2 = divmod(item, 2)
if (val2 == 0):
int_links.append(IntLink(link_id=link_count,
node_a=clovertown.routers[item],
node_b=clovertown.routers[item + 1],
weight=1))
link_count += 1
clovertown.ext_links = ext_links
clovertown.int_links = int_links
return clovertown
_______________________________________________
gem5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users