Ejemplo n.º 1
0
 def connect_slave(cls, self, slave, prefix=None):
     path = lambda node, name: '%s#%s' % (node.path, name)
     system.add_edge('CallAttrEdge',
         path(self, 'signals_dict'),
         path(slave, 'bus'),
         dict(prefix=prefix))
     return self
Ejemplo n.º 2
0
 def create_and_connect(cls, parent_path, name, bus):
     self = system.add_node(parent_path, name, 'Cpu')
     path = lambda node, name: '%s#%s' % (node.path, name)
     system.add_edge('CallAttrEdge',
         path(self, 'execute'),
         path(bus, 'masters'))
     return self
Ejemplo n.º 3
0
 def create_net(cls, self, net, width, depth=1, **kwargs):
     net_class = system.models[self.kwargs['net_class']]
     net_node = net_class.create(self.path, net, width, depth, **kwargs)
     os = system.node_at_path('/')
     path = lambda node, name: '%s#%s' % (node.path, name)
     system.add_edge('CallAttrEdge', path(os, 'interface'),
                     path(net_node, 'os'))
     return net_node
Ejemplo n.º 4
0
 def create_net(cls, self, net, width, depth=1, **kwargs):
     net_class = system.models[self.kwargs['net_class']]
     net_node = net_class.create(self.path, net, width, depth, **kwargs)
     os = system.node_at_path('/')
     path = lambda node, name: '%s#%s' % (node.path, name)
     system.add_edge('CallAttrEdge',
         path(os, 'interface'),
         path(net_node, 'os'))
     return net_node
Ejemplo n.º 5
0
 def create_and_connect(cls, parent_path, name, clearn, clk, dspflow, net):
     path = lambda node, name: '%s#%s' % (node.path, name)
     self = system.add_node(parent_path, name, 'ScopeSink', {})
     system.add_edge('CallAttrEdge', path(clearn, 'out'),
                     path(self, 'clearn'), dict(name='clearn'))
     system.add_edge('CallAttrEdge', path(clk, 'out'), path(self, 'clk'),
                     dict(name='clk'))
     DspFlow.connect(dspflow, net, self, 'signal', prefix='in_')
     return self
Ejemplo n.º 6
0
 def create_and_connect(cls, parent_path, name, en, fifo, dspflow, net):
     path = lambda node, name: '%s#%s' % (node.path, name)
     self = system.add_node(parent_path, name, 'FifoSource')
     system.add_edge('CallAttrEdge', path(en, 'out'), path(self, 'en'),
                     dict(name='en'))
     system.add_edge('CallAttrEdge', path(fifo, 'read_port'),
                     path(self, 'fifo'), dict(prefix='fifo_'))
     DspFlow.connect(dspflow, net, self, 'out', prefix='out_')
     return self
Ejemplo n.º 7
0
 def create(cls, parent_path, name, resetn, clk, duration, address_mask):
     path = lambda node, name: '%s#%s' % (node.path, name)
     self = system.add_node(parent_path, name, 'BusMatrix',
                            {'address_mask': address_mask})
     system.add_edge('CallAttrEdge', path(resetn, 'signals_dict'),
                     path(self, 'resetn'), dict(name='resetn'))
     system.add_edge('CallAttrEdge', path(clk, 'out'), path(self, 'clk'),
                     dict(name='clk'))
     return self
Ejemplo n.º 8
0
 def connect(cls, self, net, node, to, width=32, depth=1, prefix=None):  # TODO
     net_class = system.models[self.kwargs['net_class']]
     if net in self.children:
         net_node = self.children[net]
     else:
         net_node = DspFlow.create_net(self, net, width)
     net_class.connect(net_node, node, to, prefix)
     path = lambda node, name: '%s#%s' % (node.path, name)
     system.add_edge('CallAttrEdge',
         path(node, 'interface'),
         path(self, 'nodes'))
Ejemplo n.º 9
0
 def create_and_connect(cls, parent_path, name, en, fifo, dspflow, net):
     path = lambda node, name: '%s#%s' % (node.path, name)
     self = system.add_node(parent_path, name, 'FifoSource')
     system.add_edge('CallAttrEdge',
         path(en, 'out'),
         path(self, 'en'),
         dict(name='en'))
     system.add_edge('CallAttrEdge',
         path(fifo, 'read_port'),
         path(self, 'fifo'),
         dict(prefix='fifo_'))
     DspFlow.connect(dspflow, net, self, 'out', prefix='out_')
     return self
Ejemplo n.º 10
0
 def create(cls, parent_path, name, resetn, clk, duration, address_mask):
     path = lambda node, name: '%s#%s' % (node.path, name)
     self = system.add_node(parent_path, name, 'BusMatrix', {
         'address_mask': address_mask })
     system.add_edge('CallAttrEdge',
         path(resetn, 'signals_dict'),
         path(self, 'resetn'),
         dict(name='resetn'))
     system.add_edge('CallAttrEdge',
         path(clk, 'out'),
         path(self, 'clk'),
         dict(name='clk'))
     return self
Ejemplo n.º 11
0
 def create_and_connect(cls, parent_path, name, clearn, clk, dspflow, net):
     path = lambda node, name: '%s#%s' % (node.path, name)
     self = system.add_node(parent_path, name, 'ScopeSink', {})
     system.add_edge('CallAttrEdge',
         path(clearn, 'out'),
         path(self, 'clearn'),
         dict(name='clearn'))
     system.add_edge('CallAttrEdge',
         path(clk, 'out'),
         path(self, 'clk'),
         dict(name='clk'))
     DspFlow.connect(dspflow, net, self, 'signal', prefix='in_')
     return self
Ejemplo n.º 12
0
 def connect(cls,
             self,
             net,
             node,
             to,
             width=32,
             depth=1,
             prefix=None):  # TODO
     net_class = system.models[self.kwargs['net_class']]
     if net in self.children:
         net_node = self.children[net]
     else:
         net_node = DspFlow.create_net(self, net, width)
     net_class.connect(net_node, node, to, prefix)
     path = lambda node, name: '%s#%s' % (node.path, name)
     system.add_edge('CallAttrEdge', path(node, 'interface'),
                     path(self, 'nodes'))
Ejemplo n.º 13
0
 def create(cls, parent_path, name, master, duration=None, verbose=False):
     path = lambda node, name: '%s#%s' % (node.path, name)
     self = system.add_node(parent_path, name, 'Apb3Bus', {
         'duration': duration,
         'verbose': verbose
     })
     system.add_edge('CallAttrEdge', path(master, 'resetn'),
                     path(self, 'resetn'), dict(name='presetn'))
     system.add_edge('CallAttrEdge', path(master, 'clk'), path(self, 'clk'),
                     dict(name='pclk'))
     system.add_edge('CallAttrEdge', path(self, 'interface'),
                     path(master, 'slaves'))
     return self
Ejemplo n.º 14
0
 def create_and_connect(cls, parent_path, name, resetn, clka, clkb, width, depth, pipe=True):
     path = lambda node, name: '%s#%s' % (node.path, name)
     self = system.add_node(parent_path, name, 'Ram', { 'width': width, 'depth': depth, 'pipe': pipe })
     system.add_edge('CallAttrEdge',
         path(resetn, 'signals_dict'),
         path(self, 'resetn'))
     system.add_edge('CallAttrEdge',
         path(clka, 'out'),
         path(self, 'clka'))
     system.add_edge('CallAttrEdge',
         path(clkb, 'out'),
         path(self, 'clkb'))
     return self
Ejemplo n.º 15
0
 def create(cls, parent_path, name, master, duration=None, verbose=False):
     path = lambda node, name: '%s#%s' % (node.path, name)
     self = system.add_node(parent_path, name, 'Apb3Bus', {'duration': duration, 'verbose': verbose})
     system.add_edge('CallAttrEdge',
         path(master, 'resetn'),
         path(self, 'resetn'),
         dict(name='presetn'))
     system.add_edge('CallAttrEdge',
         path(master, 'clk'),
         path(self, 'clk'),
         dict(name='pclk'))
     system.add_edge('CallAttrEdge',
         path(self, 'interface'),
         path(master, 'slaves'))
     return self
Ejemplo n.º 16
0
 def create(cls, parent_path, name, clearn, clk, net_class='DspNet'):
     path = lambda node, name: '%s#%s' % (node.path, name)
     self = system.add_node(parent_path, name, 'DspFlow', {
         'net_class': net_class,
     })
     os = system.node_at_path('/')
     system.add_edge('CallAttrEdge', path(os, 'interface'),
                     path(self, 'os'))
     if clearn:
         system.add_edge('CallAttrEdge', path(clearn, 'signals_dict'),
                         path(self, 'clearn'))
     if clk:
         system.add_edge('CallAttrEdge', path(clk, 'out'),
                         path(self, 'clk'))
     return self
Ejemplo n.º 17
0
 def create_and_connect(cls, parent_path, name):
     path = lambda node, name: '%s#%s' % (node.path, name)
     os = system.node_at_path('/')
     self = system.add_node(parent_path, name, 'DspFlowController', {})
     system.add_edge('CallAttrEdge',
         path(os, 'interface'),
         path(self, 'os'))
     dsp = system.add_node(self.path, 'dsp', 'DspFlow', {
         'net_class': 'MemFifoDspNet' })
     system.add_edge('CallAttrEdge',
         path(dsp, 'interface'),
         path(self, 'dsp'))
     system.add_edge('CallAttrEdge',
         path(os, 'interface'),
         path(dsp, 'os'))
     return dsp
Ejemplo n.º 18
0
 def create_and_connect(cls, parent_path, name, resetn, wclk, rclk, width, depth):
     path = lambda node, name: '%s#%s' % (node.path, name)
     self = system.add_node(parent_path, name, 'Fifo', {'width': width, 'depth': depth})
     ram = Ram.create_and_connect(self.path, 'ram', resetn, wclk, rclk, width, depth, pipe=False)
     system.add_edge('CallAttrEdge',
         path(resetn, 'signals_dict'),
         path(self, 'resetn'))
     system.add_edge('CallAttrEdge',
         path(ram, 'port_a'),
         path(self, 'write_port'),
         dict(prefix='write_'))
     system.add_edge('CallAttrEdge',
         path(ram, 'port_b'),
         path(self, 'read_port'),
         dict(prefix='read_'))
     return self
Ejemplo n.º 19
0
 def create(cls, parent_path, name, clearn, clk, net_class='DspNet'):
     path = lambda node, name: '%s#%s' % (node.path, name)
     self = system.add_node(parent_path, name, 'DspFlow', {
         'net_class': net_class,
     })
     os = system.node_at_path('/')
     system.add_edge('CallAttrEdge',
         path(os, 'interface'),
         path(self, 'os'))
     if clearn:
         system.add_edge('CallAttrEdge',
             path(clearn, 'signals_dict'),
             path(self, 'clearn'))
     if clk:
         system.add_edge('CallAttrEdge',
             path(clk, 'out'),
             path(self, 'clk'))
     return self
Ejemplo n.º 20
0
 def create_and_connect(cls,
                        parent_path,
                        name,
                        resetn,
                        clka,
                        clkb,
                        width,
                        depth,
                        pipe=True):
     path = lambda node, name: '%s#%s' % (node.path, name)
     self = system.add_node(parent_path, name, 'Ram', {
         'width': width,
         'depth': depth,
         'pipe': pipe
     })
     system.add_edge('CallAttrEdge', path(resetn, 'signals_dict'),
                     path(self, 'resetn'))
     system.add_edge('CallAttrEdge', path(clka, 'out'), path(self, 'clka'))
     system.add_edge('CallAttrEdge', path(clkb, 'out'), path(self, 'clkb'))
     return self
Ejemplo n.º 21
0
 def create_and_connect(cls, parent_path, name, resetn, wclk, rclk, width,
                        depth):
     path = lambda node, name: '%s#%s' % (node.path, name)
     self = system.add_node(parent_path, name, 'Fifo', {
         'width': width,
         'depth': depth
     })
     ram = Ram.create_and_connect(self.path,
                                  'ram',
                                  resetn,
                                  wclk,
                                  rclk,
                                  width,
                                  depth,
                                  pipe=False)
     system.add_edge('CallAttrEdge', path(resetn, 'signals_dict'),
                     path(self, 'resetn'))
     system.add_edge('CallAttrEdge', path(ram, 'port_a'),
                     path(self, 'write_port'), dict(prefix='write_'))
     system.add_edge('CallAttrEdge', path(ram, 'port_b'),
                     path(self, 'read_port'), dict(prefix='read_'))
     return self
Ejemplo n.º 22
0
 def connect(cls, self, to, to_port):
     path = lambda node, name: '%s#%s' % (node.path, name)
     print self, to, to_port
     system.add_edge('CallAttrEdge',
         path(self, 'signals_dict'),
         path(to, to_port))
Ejemplo n.º 23
0
 def connect(cls, self, node, to, prefix=None):
     path = lambda node, name: '%s#%s' % (node.path, name)
     system.add_edge('CallAttrEdge', path(self, 'signals_dict'),
                     path(node, to), dict(prefix=prefix))
Ejemplo n.º 24
0
 def connect_slave(cls, self, slave, prefix=None):
     path = lambda node, name: '%s#%s' % (node.path, name)
     system.add_edge('CallAttrEdge', path(self, 'signals_dict'),
                     path(slave, 'bus'), dict(prefix=prefix))
     return self
Ejemplo n.º 25
0
 def connect(cls, self, node, to, prefix=None):
     path = lambda node, name: '%s#%s' % (node.path, name)
     system.add_edge('CallAttrEdge',
         path(self, 'signals_dict'),
         path(node, to),
         dict(prefix=prefix))
Ejemplo n.º 26
0
 def connect(cls, self, node, to, prefix=None):
     path = lambda node, name: '%s#%s' % (node.path, name)
     system.add_edge('CallAttrEdge',
         path(self, 'interface'),
         path(node, to))