Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions m2isar/backends/coverage/coverage_dbg.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def main():
if model_obj.model_version != M2_METAMODEL_VERSION:
logger.warning("Loaded model version mismatch")

for core_name, core_obj in model_obj.models.items():
for core_name, core_obj in model_obj.cores.items():
process_functions(core_obj)
process_instructions(core_obj)
process_attributes(core_obj)
Expand All @@ -70,7 +70,7 @@ def main():

ctx = IdMatcherContext()

for core_name, core_obj in model_obj.models.items():
for core_name, core_obj in model_obj.cores.items():
ctx.arch_name = core_name

for fn_name, fn_obj in core_obj.functions.items():
Expand Down
8 changes: 4 additions & 4 deletions m2isar/backends/coverage/coverage_lcov.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,12 @@ def main():
logger.warning("Loaded model version mismatch")

if args.target_arch is not None:
models_to_use = {arch_name: model_obj.models[arch_name] for arch_name in args.target_arch}
model_obj.models = models_to_use
cores_to_use = {arch_name: model_obj.cores[arch_name] for arch_name in args.target_arch}
model_obj.cores = cores_to_use

logger.info("preprocessing models")

for core_name, core_obj in model_obj.models.items():
for core_name, core_obj in model_obj.cores.items():
process_functions(core_obj)
process_instructions(core_obj)
process_attributes(core_obj)
Expand All @@ -141,7 +141,7 @@ def main():

ctx = IdMatcherContext()

for core_name, core_obj in model_obj.models.items():
for core_name, core_obj in model_obj.cores.items():
ctx.arch_name = core_name

for fn_name, fn_obj in core_obj.functions.items():
Expand Down
4 changes: 2 additions & 2 deletions m2isar/backends/disass/disass.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ def main():
if model_obj.model_version != M2_METAMODEL_VERSION:
logger.warning("Loaded model version mismatch")

models = model_obj.models
cores = model_obj.cores

core = models[args.core_name]
core = cores[args.core_name]
readlen = max(core.instr_classes) // 8
steplen = min(core.instr_classes) // 8

Expand Down
10 changes: 5 additions & 5 deletions m2isar/backends/etiss/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,18 +121,18 @@ def setup():

start_time = time.strftime("%a, %d %b %Y %H:%M:%S %z", time.localtime())

assert len(model_obj.models) > 0, "No cores found in metamodel"
assert len(model_obj.cores) > 0, "No cores found in metamodel"

return (model_obj.models, logger, output_base_path, spec_name, start_time, args)
return (model_obj.cores, logger, output_base_path, spec_name, start_time, args)

def main():
"""etiss_writer main entrypoint function."""

# setup etiss writer
models, logger, output_base_path, spec_name, start_time, args = setup()
cores, logger, output_base_path, spec_name, start_time, args = setup()

# preprocess all models
for core_name, core in models.items():
for core_name, core in cores.items():
logger.info("preprocessing model %s", core_name)
process_functions(core)
process_instructions(core)
Expand All @@ -151,7 +151,7 @@ def main():
core.functions = renamed_fns

# generate each core in the model
for core_name, core in models.items():
for core_name, core in cores.items():
logger.info("processing model %s", core_name)

# create output files path
Expand Down
6 changes: 3 additions & 3 deletions m2isar/backends/viewer/viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ def main():
if model_obj.model_version != M2_METAMODEL_VERSION:
logger.warning("Loaded model version mismatch")

models = model_obj.models
cores = model_obj.cores

# preprocess model
for core_name, core in models.items():
for core_name, core in cores.items():
logger.info("preprocessing model %s", core_name)
process_functions(core)
process_instructions(core)
Expand All @@ -101,7 +101,7 @@ def main():
tree.heading(1, text="Value")

# add each core to the treeview
for core_name, core_def in sorted(models.items()):
for core_name, core_def in sorted(cores.items()):
core_id = tree.insert("", tk.END, text=core_name)

# add constants to tree
Expand Down
2 changes: 1 addition & 1 deletion m2isar/frontends/coredsl2/CoreDSL2.g4
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ isa

section
: type_='architectural_state' '{' (declarations+=declaration | expressions+=expression ';')+ '}' # section_arch_state
| type_='functions' '{' functions+=function_definition+ '}' # section_functions
| type_='functions' '{' functions+=function_definition* '}' # section_functions
| type_='instructions' attributes+=attribute* '{' instructions+=instruction* '}' # section_instructions
| type_='always' attributes+=attribute* '{' always_blocks+=always_block+ '}' # section_always
;
Expand Down
9 changes: 9 additions & 0 deletions m2isar/frontends/coredsl2/parser_gen/CoreDSL2Listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,15 @@ def exitCharacter_constant(self, ctx:CoreDSL2Parser.Character_constantContext):
pass


# Enter a parse tree produced by CoreDSL2Parser#string_constant.
def enterString_constant(self, ctx:CoreDSL2Parser.String_constantContext):
pass

# Exit a parse tree produced by CoreDSL2Parser#string_constant.
def exitString_constant(self, ctx:CoreDSL2Parser.String_constantContext):
pass


# Enter a parse tree produced by CoreDSL2Parser#double_left_bracket.
def enterDouble_left_bracket(self, ctx:CoreDSL2Parser.Double_left_bracketContext):
pass
Expand Down
Loading