build-tools/newad.py
def print_instance_ports(inst, mod, gvar, gcnt, fd):
    '''
    Print the port assignments for the instantiation of a module.
    At the same time, append to the self_ports and decodes strings,
    so the variables mapped to the ports can get adequately defined.
    '''
    instance_ports = port_lists[mod]
    if fd:
        # 'list comprehension' for the port list itself
        this_list = [one_port(inst, p.name, gvar) for p in instance_ports]
        if this_list:
            tail = ' ' + ',\\\n\t'.join(this_list)
        else:
            tail = ''
        fd.write('`define AUTOMATIC_' + inst + tail)
        fd.write('\n')
    #  now construct the self_ports and decoders (if any)
    for p in instance_ports:
        sig = '' if (p.sign is None) else p.sign  # signed flag
        if gvar is None:
            self_ports.append('%s %s [%s:%s] %s_%s' %
                              (p.direction, sig, p.downto[0], p.downto[1],
                               inst, re.sub(':', '_', p.name)))
        else:
            for ig in range(gcnt):
                self_ports.append('%s %s [%s:%s] %s_%d_%s' %
                                  (p.direction, sig, p.downto[0], p.downto[1],
                                   inst, ig, re.sub(':', '_', p.name)))
        make_decoder(inst, mod, p, gcnt)

    Print the port assignments for the instantiation of a module.
    At the same time, append to the self_ports and decodes strings,
    so the variables mapped to the ports can get adequately defined.
    
Print the port assignments for the instantiation of a module.
At the same time, append to the self_ports and decodes strings,
so the variables mapped to the ports can get adequately defined.
Print the port assignments for the instantiation of a module . At the same time append to the self_ports and decodes strings so the variables mapped to the ports can get adequately defined .
def print_instance_ports(inst, mod, gvar, gcnt, fd):
    instance_ports = port_lists[mod]
    if fd:
        this_list = [one_port(inst, p.name, gvar) for p in instance_ports]
        if this_list:
            tail = ' ' + ',\\\n\t'.join(this_list)
        else:
            tail = ''
        fd.write('`define AUTOMATIC_' + inst + tail)
        fd.write('\n')
    for p in instance_ports:
        sig = '' if (p.sign is None) else p.sign  
        if gvar is None:
            self_ports.append('%s %s [%s:%s] %s_%s' %
                              (p.direction, sig, p.downto[0], p.downto[1],
                               inst, re.sub(':', '_', p.name)))
        else:
            for ig in range(gcnt):
                self_ports.append('%s %s [%s:%s] %s_%d_%s' %
                                  (p.direction, sig, p.downto[0], p.downto[1],
                                   inst, ig, re.sub(':', '_', p.name)))
        make_decoder(inst, mod, p, gcnt)
def print_instance_ports ( inst , mod , gvar , gcnt , fd ) : instance_ports = port_lists [ mod ] if fd : this_list = [ one_port ( inst , p . name , gvar ) for p in instance_ports ] if this_list : tail = ' ' + ',\\\n\t' . join ( this_list ) else : tail = '' fd . write ( '`define AUTOMATIC_' + inst + tail ) fd . write ( '\n' ) for p in instance_ports : sig = '' if ( p . sign is None ) else p . sign if gvar is None : self_ports . append ( '%s %s [%s:%s] %s_%s' % ( p . direction , sig , p . downto [ 0 ] , p . downto [ 1 ] , inst , re . sub ( ':' , '_' , p . name ) ) ) else : for ig in range ( gcnt ) : self_ports . append ( '%s %s [%s:%s] %s_%d_%s' % ( p . direction , sig , p . downto [ 0 ] , p . downto [ 1 ] , inst , ig , re . sub ( ':' , '_' , p . name ) ) ) make_decoder ( inst , mod , p , gcnt )
Print the port assignments for the instantiation of a module.
Print the port assignments for the instantiation of a module .
'''
    Print the port assignments for the instantiation of a module.
    At the same time, append to the self_ports and decodes strings,
    so the variables mapped to the ports can get adequately defined.
    ''' # 'list comprehension' for the port list itself #  now construct the self_ports and decoders (if any) # signed flag
inst
mod
gvar
gcnt
fd