Commit 4924a208 authored by dbarbera's avatar dbarbera
Browse files

Fix input signal name

parent 34b8285b
...@@ -35,7 +35,8 @@ g = None ...@@ -35,7 +35,8 @@ g = None
class GlobalState(): class GlobalState():
def __init__(self, process): def __init__(self, process):
self.module = core.Module.new(str(process.processName)) self.name = str(process.processName)
self.module = core.Module.new(self.name)
self.dataview = process.dataview self.dataview = process.dataview
self.scope = {} self.scope = {}
...@@ -118,13 +119,13 @@ def _process(process): ...@@ -118,13 +119,13 @@ def _process(process):
# Generate process functions # Generate process functions
runtr_func = _generate_runtr_func(process) runtr_func = _generate_runtr_func(process)
_generate_startup_func(process, str(process.processName), runtr_func) _generate_startup_func(process, runtr_func)
# Generate input signals # Generate input signals
for signal in process.input_signals: for signal in process.input_signals:
_generate_input_signal(signal, mapping[signal['name']]) _generate_input_signal(signal, mapping[signal['name']])
with open(str(process.processName) + '.ll', 'w') as ll_file: with open(g.name + '.ll', 'w') as ll_file:
ll_file.write(str(g.module)) ll_file.write(str(g.module))
...@@ -176,9 +177,9 @@ def _generate_runtr_func(process): ...@@ -176,9 +177,9 @@ def _generate_runtr_func(process):
return func return func
def _generate_startup_func(process, process_name, runtr_func): def _generate_startup_func(process, runtr_func):
''' Generate code for the startup function ''' ''' Generate code for the startup function '''
func_name = process_name + '_startup' func_name = g.name + '_startup'
func_type = core.Type.function(g.void, []) func_type = core.Type.function(g.void, [])
func = core.Function.new(g.module, func_type, func_name) func = core.Function.new(g.module, func_type, func_name)
...@@ -196,7 +197,7 @@ def _generate_startup_func(process, process_name, runtr_func): ...@@ -196,7 +197,7 @@ def _generate_startup_func(process, process_name, runtr_func):
def _generate_input_signal(signal, inputs): def _generate_input_signal(signal, inputs):
''' Generate code for an input signal ''' ''' Generate code for an input signal '''
func_name = str(signal['name']) func_name = g.name + "_" + str(signal['name'])
param_tys = [] param_tys = []
if 'type' in signal: if 'type' in signal:
param_tys.append(core.Type.pointer(_generate_type(signal['type']))) param_tys.append(core.Type.pointer(_generate_type(signal['type'])))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment