示例#1
0
def setup_clock(m, clk, hperiod=5):
    ret = m.Initial(clk(0), vtypes.Forever(clk(vtypes.Not(clk),
                                               ldelay=hperiod)))

    # for verilator
    if not hasattr(m, 'verilator_clock'):
        m.verilator_clock = collections.OrderedDict()

    m.verilator_clock[clk] = hperiod

    return ret
示例#2
0
 def visit_ForeverStatement(self, node):
     statement = to_tuple(self.visit(node.statement))
     forever = vtypes.Forever(*statement)
     return forever
示例#3
0
def setup_clock(m, clk, hperiod=5):
    ret = m.Initial(clk(0), vtypes.Forever(clk(vtypes.Not(clk),
                                               ldelay=hperiod)))
    return ret