micro_asm.py (4507:487b70cfd58d) | micro_asm.py (4508:837161d544c3) |
---|---|
1# Copyright (c) 2003-2005 The Regents of The University of Michigan 2# All rights reserved. 3# 4# Redistribution and use in source and binary forms, with or without 5# modification, are permitted provided that the following conditions are 6# met: redistributions of source code must retain the above copyright 7# notice, this list of conditions and the following disclaimer; 8# redistributions in binary form must reproduce the above copyright --- 58 unchanged lines hidden (view full) --- 67class Combinational_Macroop(Micro_Container): 68 pass 69 70class Rom_Macroop(object): 71 def __init__(self, name, target): 72 self.name = name 73 self.target = target 74 | 1# Copyright (c) 2003-2005 The Regents of The University of Michigan 2# All rights reserved. 3# 4# Redistribution and use in source and binary forms, with or without 5# modification, are permitted provided that the following conditions are 6# met: redistributions of source code must retain the above copyright 7# notice, this list of conditions and the following disclaimer; 8# redistributions in binary form must reproduce the above copyright --- 58 unchanged lines hidden (view full) --- 67class Combinational_Macroop(Micro_Container): 68 pass 69 70class Rom_Macroop(object): 71 def __init__(self, name, target): 72 self.name = name 73 self.target = target 74 |
75 def __str__(self): 76 return "%s: %s\n" % (self.name, self.target) 77 |
|
75class Rom(Micro_Container): 76 def __init__(self, name): 77 super(Rom, self).__init__(name) 78 self.externs = {} 79 80########################################################################## 81# 82# Support classes --- 241 unchanged lines hidden (view full) --- 324 325# Defines a macroop that jumps to an external label in the ROM 326def p_macroop_def_0(t): 327 'macroop_def : DEF MACROOP ID LPAREN ID RPAREN SEMI' 328 if not t.parser.rom_macroop_type: 329 print_error("ROM based macroop found, but no ROM macroop class was specified.") 330 raise TypeError, "ROM based macroop found, but no ROM macroop class was specified." 331 macroop = t.parser.rom_macroop_type(t[3], t[5]) | 78class Rom(Micro_Container): 79 def __init__(self, name): 80 super(Rom, self).__init__(name) 81 self.externs = {} 82 83########################################################################## 84# 85# Support classes --- 241 unchanged lines hidden (view full) --- 327 328# Defines a macroop that jumps to an external label in the ROM 329def p_macroop_def_0(t): 330 'macroop_def : DEF MACROOP ID LPAREN ID RPAREN SEMI' 331 if not t.parser.rom_macroop_type: 332 print_error("ROM based macroop found, but no ROM macroop class was specified.") 333 raise TypeError, "ROM based macroop found, but no ROM macroop class was specified." 334 macroop = t.parser.rom_macroop_type(t[3], t[5]) |
332 t[0] = macroop | 335 t.parser.macroops[t[3]] = macroop |
333 334 335# Defines a macroop that is combinationally generated 336def p_macroop_def_1(t): 337 'macroop_def : DEF MACROOP ID block SEMI' 338 try: 339 curop = t.parser.macro_type(t[3]) 340 except TypeError: --- 133 unchanged lines hidden --- | 336 337 338# Defines a macroop that is combinationally generated 339def p_macroop_def_1(t): 340 'macroop_def : DEF MACROOP ID block SEMI' 341 try: 342 curop = t.parser.macro_type(t[3]) 343 except TypeError: --- 133 unchanged lines hidden --- |