Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
OpenGEODE
Commits
4924a208
Commit
4924a208
authored
Jun 17, 2014
by
dbarbera
Browse files
Fix input signal name
parent
34b8285b
Changes
1
Hide whitespace changes
Inline
Side-by-side
LlvmGenerator.py
View file @
4924a208
...
...
@@ -35,7 +35,8 @@ g = None
class
GlobalState
():
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
.
scope
=
{}
...
...
@@ -118,13 +119,13 @@ def _process(process):
# Generate process functions
runtr_func
=
_generate_runtr_func
(
process
)
_generate_startup_func
(
process
,
str
(
process
.
processName
),
runtr_func
)
_generate_startup_func
(
process
,
runtr_func
)
# Generate input signals
for
signal
in
process
.
input_signals
:
_generate_input_signal
(
signal
,
mapping
[
signal
[
'name'
]])
with
open
(
str
(
process
.
processN
ame
)
+
'.ll'
,
'w'
)
as
ll_file
:
with
open
(
g
.
n
ame
+
'.ll'
,
'w'
)
as
ll_file
:
ll_file
.
write
(
str
(
g
.
module
))
...
...
@@ -176,9 +177,9 @@ def _generate_runtr_func(process):
return
func
def
_generate_startup_func
(
process
,
process_name
,
runtr_func
):
def
_generate_startup_func
(
process
,
runtr_func
):
''' Generate code for the startup function '''
func_name
=
process_
name
+
'_startup'
func_name
=
g
.
name
+
'_startup'
func_type
=
core
.
Type
.
function
(
g
.
void
,
[])
func
=
core
.
Function
.
new
(
g
.
module
,
func_type
,
func_name
)
...
...
@@ -196,7 +197,7 @@ def _generate_startup_func(process, process_name, runtr_func):
def
_generate_input_signal
(
signal
,
inputs
):
''' Generate code for an input signal '''
func_name
=
str
(
signal
[
'name'
])
func_name
=
g
.
name
+
"_"
+
str
(
signal
[
'name'
])
param_tys
=
[]
if
'type'
in
signal
:
param_tys
.
append
(
core
.
Type
.
pointer
(
_generate_type
(
signal
[
'type'
])))
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment