#NEWLINE# def __init__( s , num_entries , num_nbytes , reset_value = 0 ) : #NEWLINE# #INDENT# addr_nbits = clog2 ( num_entries ) #NEWLINE# s . reset_value = num_entries #NEWLINE# s . num_entries = num_entries #NEWLINE# s . num_nbytes = num_nbytes #NEWLINE# s . data_nbits = ( num_nbytes * 8 ) #NEWLINE# s . wen = InPort ( 1 ) #NEWLINE# s . wben = InPort ( s . num_nbytes ) #NEWLINE# s . addr = InPort ( addr_nbits ) #NEWLINE# s . wdata = InPort ( s . data_nbits ) #NEWLINE# s . rdata = OutPort ( s . data_nbits ) #NEWLINE# s . mem = [ Wire ( s . data_nbits ) for x in xrange ( num_entries ) ]