Skip to content

Commit

Permalink
Merge 5bee737 into f8327e8
Browse files Browse the repository at this point in the history
  • Loading branch information
rsetaluri committed Nov 2, 2018
2 parents f8327e8 + 5bee737 commit 087f08c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions magma/backend/coreir_.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from .util import make_relative, get_codegen_debug_info
from ..interface import InterfaceKind
import copy
import json

from collections import defaultdict

Expand Down Expand Up @@ -290,6 +291,15 @@ def compile_definition(self, definition):
self.check_interface(definition)
module_type = self.convert_interface_to_module_type(definition.interface)
coreir_module = self.context.global_namespace.new_module(definition.coreir_name, module_type)

# If this module was imported from verilog, do not go through the
# general module construction flow. Instead just attach the verilog
# source as metadata and return the module.
if hasattr(definition, "verilogFile"):
verilog_metadata = {"verilog_string": definition.verilogFile}
coreir_module.add_metadata("verilog", json.dumps(verilog_metadata))
return coreir_module

module_definition = coreir_module.new_definition()
self.compile_definition_to_module_definition(definition, module_definition)
coreir_module.definition = module_definition
Expand Down

0 comments on commit 087f08c

Please sign in to comment.