X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Farch%2Fmicro_asm_test.py;h=b074ecb58f55e20110102f25b06bdadb70ece2cb;hb=961aafc044b934ac0e5d1ffe51fc5f33813b052b;hp=816a74b71ef566b60ebecc6445459da88e7eb55e;hpb=8ab0ffa3dd283b9f710246ba1e3b0c077bd64dc3;p=gem5.git diff --git a/src/arch/micro_asm_test.py b/src/arch/micro_asm_test.py index 816a74b71..b074ecb58 100755 --- a/src/arch/micro_asm_test.py +++ b/src/arch/micro_asm_test.py @@ -26,7 +26,7 @@ # # Authors: Gabe Black -from micro_asm import MicroAssembler, Macroop, Rom +from micro_asm import MicroAssembler, Combinational_Macroop, Rom_Macroop, Rom class Bah(object): def __init__(self): @@ -52,20 +52,23 @@ microops = { "dah": Dah } -class TestMacroop(Macroop): +class TestMacroop(Combinational_Macroop): def tweak(self): microops["bah"] = Bah_Tweaked def untweak(self): microops["bah"] = Bah + def print_debug(self, message): + print message def __init__(self, name): super(TestMacroop, self).__init__(name) self.directives = { "tweak": self.tweak, - "untweak": self.untweak + "untweak": self.untweak, + "print": self.print_debug } -assembler = MicroAssembler(TestMacroop, microops, Rom('main ROM')) +assembler = MicroAssembler(TestMacroop, microops, Rom('main ROM'), Rom_Macroop) testAssembly = ''' # Single line comment @@ -82,11 +85,19 @@ def macroop squishy { .tweak bah .untweak + .print "In the midst" bah dah # single line comment after something .tweak }; +#Extending the rom... +def rom +{ + #Here's more stuff for the rom + bah +}; + def macroop squashy { bah };