def __init__(self, env, qlimit = None, rate=1000): self.env = env # parameters self.qlimit = qlimit self.rate = rate # variables # store resources self.S_in = simpy.Store(env) self.S_out = simpy.Store(env) self.S_gc = simpy.Store(env) self.S_db = simpy.Store(env) self.S_st5q_in = simpy.Store(env) self.S_st5q_out =simpy.Store(env) self.S_st4q_in = simpy.Store(env) self.S_st4q_out =simpy.Store(env) self.S_st3q_in = simpy.Store(env) self.S_st3q_out =simpy.Store(env) self.S_st2q_in = simpy.Store(env) self.S_st2q_out =simpy.Store(env) self.S_st1q_in = simpy.Store(env) self.S_st1q_out =simpy.Store(env) self.S_beq_in = simpy.Store(env) self.S_beq_out =simpy.Store(env) self.S_nmq_in = simpy.Store(env) self.S_nmq_out =simpy.Store(env) # input connection self.input = self.S_in self.in_gc = self.S_gc self.in_nm = self.S_nmq_in self.in_db = self.S_db # output (should always be set to "None") self.output = None # running concurrent processes self.action = env.process(self.r_in()) self.action = env.process(self.r_db()) self.action = env.process(self.r_out()) self.action = env.process(self.r_gc()) self.action = env.process(self.r_i5()) self.action = env.process(self.r_o5()) self.action = env.process(self.r_i4()) self.action = env.process(self.r_o4()) self.action = env.process(self.r_i3()) self.action = env.process(self.r_o3()) self.action = env.process(self.r_i2()) self.action = env.process(self.r_o2()) self.action = env.process(self.r_i1()) self.action = env.process(self.r_o1()) self.action = env.process(self.r_ibe()) self.action = env.process(self.r_obe()) self.action = env.process(self.r_inm()) self.action = env.process(self.r_onm()) # instantiating sub-blocks and connecting its outputs to a store resource self.dmux = dmux(env); self.dmux.out_st_5 = self.S_st5q_in self.dmux.out_st_4 = self.S_st4q_in self.dmux.out_st_3 = self.S_st3q_in self.dmux.out_st_2 = self.S_st2q_in self.dmux.out_st_1 = self.S_st1q_in self.dmux.out_be = self.S_beq_in self.priority_router = priority_router(env) self.priority_router.output = self.S_out self.qg_st_5 = queue_gate(env, gid=5, qlimit=self.qlimit) self.qg_st_5.output = self.S_st5q_out self.qg_st_4 = queue_gate(env, gid=4, qlimit=self.qlimit) self.qg_st_4.output = self.S_st4q_out self.qg_st_3 = queue_gate(env, gid=3, qlimit=self.qlimit) self.qg_st_3.output = self.S_st3q_out self.qg_st_2 = queue_gate(env, gid=2, qlimit=self.qlimit) self.qg_st_2.output = self.S_st2q_out self.qg_st_1 = queue_gate(env, gid=1, qlimit=self.qlimit) self.qg_st_1.output = self.S_st1q_out self.qg_be = queue_gate(env, gid = -1, qlimit=self.qlimit) self.qg_be.output = self.S_beq_out self.qg_nm = queue_gate(env, gid=0, qlimit=self.qlimit) self.qg_nm.output = self.S_nmq_out # instantiating a packet object self.pkt = None
def __init__(self, env, qlimit=1000, gcl_ts_list=[[10e-6],[40e-6]],\ gcl_list=[[1],[-1]], rate=1000): self.env = env # parameters self.qlimit = qlimit self.gc_ts_list = gcl_ts_list self.gc_id_list = gcl_list self.rate = rate # variables self.var_gce = None # store resources self.S_in = simpy.Store(env) self.S_out = simpy.Store(env) self.S_gce = simpy.Store(env) self.S_st5q_in = simpy.Store(env) self.S_st5q_out = simpy.Store(env) self.S_st4q_in = simpy.Store(env) self.S_st4q_out = simpy.Store(env) self.S_st3q_in = simpy.Store(env) self.S_st3q_out = simpy.Store(env) self.S_st2q_in = simpy.Store(env) self.S_st2q_out = simpy.Store(env) self.S_st1q_in = simpy.Store(env) self.S_st1q_out = simpy.Store(env) self.S_st0q_in = simpy.Store(env) self.S_st0q_out = simpy.Store(env) self.S_beq_in = simpy.Store(env) self.S_beq_out = simpy.Store(env) self.S_pas = simpy.Store(env) # input connection self.input = self.S_in # output (should always be set to "None") self.output = None # running concurrent processes self.action = env.process(self.r_in()) self.action = env.process(self.r_out()) self.action = env.process(self.r_gce()) self.action = env.process(self.r_i5()) self.action = env.process(self.r_i4()) self.action = env.process(self.r_i3()) self.action = env.process(self.r_i2()) self.action = env.process(self.r_i1()) self.action = env.process(self.r_i0()) self.action = env.process(self.r_ibe()) # instantiating sub-blocks and connecting its outputs to a store resource self.dmux = dmux(env) self.dmux.out_st_5 = self.S_st5q_in self.dmux.out_st_4 = self.S_st4q_in self.dmux.out_st_3 = self.S_st3q_in self.dmux.out_st_2 = self.S_st2q_in self.dmux.out_st_1 = self.S_st1q_in self.dmux.out_st_0 = self.S_st0q_in self.dmux.out_be = self.S_beq_in self.gcl_generator = gcl_generator(env, gcl_ts_list=self.gc_ts_list,\ gcl_list=self.gc_id_list) self.gcl_generator.output = self.S_gce self.qg_st5 = queue_gate(env, gid=5, qlimit=self.qlimit) self.qg_st5.output = self.S_st5q_out self.qg_st5.pas = self.S_pas self.qg_st4 = queue_gate(env, gid=4, qlimit=self.qlimit) self.qg_st4.output = self.S_st4q_out self.qg_st4.pas = self.S_pas self.qg_st3 = queue_gate(env, gid=3, qlimit=self.qlimit) self.qg_st3.output = self.S_st3q_out self.qg_st3.pas = self.S_pas self.qg_st2 = queue_gate(env, gid=2, qlimit=self.qlimit) self.qg_st2.output = self.S_st2q_out self.qg_st2.pas = self.S_pas self.qg_st1 = queue_gate(env, gid=1, qlimit=self.qlimit) self.qg_st1.output = self.S_st1q_out self.qg_st1.pas = self.S_pas self.qg_st0 = queue_gate(env, gid=0, qlimit=self.qlimit) self.qg_st0.output = self.S_st0q_out self.qg_st0.pas = self.S_pas self.qg_be = queue_gate(env, gid=-1, qlimit=self.qlimit) self.qg_be.output = self.S_beq_out self.qg_be.pas = self.S_pas
def __init__(self, env, qlimit=1000, gcl_ts_list=[[1e-3]], gcl_list=[[-1, 1, 2]], pro_delay=1e-6): self.env = env # parameters self.qlimit = qlimit self.gcl_ts_list = gcl_ts_list self.gcl_list = gcl_list self.pro_delay = pro_delay # variables # store resources self.S_in = simpy.Store(env) self.S_out = simpy.Store(env) self.S_gcl = simpy.Store(env) self.S_st2q_in = simpy.Store(env) self.S_st2q_out = simpy.Store(env) self.S_st1q_in = simpy.Store(env) self.S_st1q_out = simpy.Store(env) self.S_beq_in = simpy.Store(env) self.S_beq_out = simpy.Store(env) # input connection self.input = self.S_in # output (should always be set to "None") self.output = None # running concurrent processes self.action = env.process(self.r_in()) self.action = env.process(self.r_out()) self.action = env.process(self.r_gcl()) self.action = env.process(self.r_i2()) self.action = env.process(self.r_o2()) self.action = env.process(self.r_i1()) self.action = env.process(self.r_o1()) self.action = env.process(self.r_ibe()) self.action = env.process(self.r_obe()) # instantiating sub-blocks and connecting its outputs to a store resource self.dmux = dmux(env) self.dmux.out_st_2 = self.S_st2q_in self.dmux.out_st_1 = self.S_st1q_in self.dmux.out_be = self.S_beq_in self.priority_router = priority_router(env) self.priority_router.output = self.S_out self.gcl_generator = gcl_generator(env, gcl_ts_list=self.gcl_ts_list, gcl_list=self.gcl_list) self.gcl_generator.output = self.S_gcl self.qg_st_2 = queue_gate(env, gid=2, qlimit=self.qlimit) self.qg_st_2.output = self.S_st2q_out self.qg_st_1 = queue_gate(env, gid=1, qlimit=self.qlimit) self.qg_st_1.output = self.S_st1q_out self.qg_be = queue_gate(env, gid=-1, qlimit=self.qlimit) self.qg_be.output = self.S_beq_out # instantiating a packet object self.pkt = None