Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lustre-v6
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
verimag
synchrone
lustre-v6
Commits
3e25cf54
Commit
3e25cf54
authored
12 years ago
by
Erwan Jahier
Browse files
Options
Downloads
Patches
Plain Diff
The -exec mode now supports explicit arrays expression (e.g., [4,3,r])
parent
bb6b76d9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/socExecEvalPredef.ml
+30
-13
30 additions, 13 deletions
src/socExecEvalPredef.ml
src/socPredef.ml
+38
-6
38 additions, 6 deletions
src/socPredef.ml
with
68 additions
and
19 deletions
src/socExecEvalPredef.ml
+
30
−
13
View file @
3e25cf54
(* Time-stamp: <modified the 20/03/2013 (at 17:
2
5) by Erwan Jahier> *)
(* Time-stamp: <modified the 20/03/2013 (at 17:5
7
) by Erwan Jahier> *)
open
SocExecValue
open
Soc
...
...
@@ -205,21 +205,37 @@ let lustre_if ctx =
in
{
ctx
with
s
=
sadd
ctx
.
s
vn
vv
}
let
lustre_
hat
tl
ctx
=
let
i
=
match
tl
with
|
[
_
;
Soc
.
Array
(
_
,
i
)
]
->
i
let
lustre_
array
tl
ctx
=
let
t
,
size
=
match
List
.
hd
(
List
.
rev
tl
)
with
|
Soc
.
Array
(
t
,
i
)
->
t
,
i
|
_
->
assert
false
in
let
(
vn
,
vv
)
=
match
([
get_val
"x"
ctx
])
with
|
[
B
x
]
->
"z"
::
ctx
.
cpath
,
A
(
Array
.
make
i
(
B
x
))
|
[
I
x
]
->
"z"
::
ctx
.
cpath
,
A
(
Array
.
make
i
(
I
x
))
|
[
F
x
]
->
"z"
::
ctx
.
cpath
,
A
(
Array
.
make
i
(
F
x
))
|
[
A
x
]
->
"z"
::
ctx
.
cpath
,
A
(
Array
.
make
i
(
A
x
))
|
[
U
]
->
"z"
::
ctx
.
cpath
,
U
|
_
->
assert
false
let
inames
=
let
res
=
ref
[]
in
for
k
=
size
downto
1
do
res
:=
(
"x"
^
(
string_of_int
k
))
::
!
res
;
done
;
!
res
in
{
ctx
with
s
=
sadd
ctx
.
s
vn
vv
}
let
l
=
List
.
map
(
fun
name
->
get_val
name
ctx
)
inames
in
let
a
=
Array
.
of_list
l
in
{
ctx
with
s
=
sadd
ctx
.
s
(
"z"
::
ctx
.
cpath
)
(
A
a
)
}
let
lustre_hat
tl
ctx
=
let
i
=
match
tl
with
|
[
_
;
Soc
.
Array
(
_
,
i
)]
->
i
|
_
->
assert
false
in
let
(
vn
,
vv
)
=
match
([
get_val
"x"
ctx
])
with
|
[
B
x
]
->
"z"
::
ctx
.
cpath
,
A
(
Array
.
make
i
(
B
x
))
|
[
I
x
]
->
"z"
::
ctx
.
cpath
,
A
(
Array
.
make
i
(
I
x
))
|
[
F
x
]
->
"z"
::
ctx
.
cpath
,
A
(
Array
.
make
i
(
F
x
))
|
[
A
x
]
->
"z"
::
ctx
.
cpath
,
A
(
Array
.
make
i
(
A
x
))
|
[
U
]
->
"z"
::
ctx
.
cpath
,
U
|
_
->
assert
false
in
{
ctx
with
s
=
sadd
ctx
.
s
vn
vv
}
(* That one is different *)
let
lustre_xor
ctx
=
assert
false
...
...
@@ -260,6 +276,7 @@ let (get: Soc.key -> (ctx -> ctx)) =
|
"Lustre::if"
->
lustre_if
|
"Lustre::hat"
->
lustre_hat
tl
|
"Lustre::array"
->
lustre_array
tl
|
"Lustre::xor"
->
lustre_xor
|
"Lustre::diese"
->
lustre_diese
...
...
This diff is collapsed.
Click to expand it.
src/socPredef.ml
+
38
−
6
View file @
3e25cf54
(* Time-stamp: <modified the
19
/03/2013 (at 1
4:39
) by Erwan Jahier> *)
(* Time-stamp: <modified the
20
/03/2013 (at 1
8:01
) by Erwan Jahier> *)
(** Synchronous Object Code for Predefined operators. *)
...
...
@@ -353,9 +353,42 @@ let make_slice_soc: Lic.slice_info -> Soc.var_type -> Soc.t =
(* init = None; *)
}
let
gen_index_list
n
=
let
rec
aux
acc
i
n
=
if
i
<
0
then
acc
else
aux
(
i
::
acc
)
(
i
-
1
)
n
in
aux
[]
(
n
-
1
)
n
let
_
=
assert
(
gen_index_list
5
=
[
0
;
1
;
2
;
3
;
4
])
let
make_array_soc
:
int
->
Soc
.
var_type
->
Soc
.
t
=
fun
i
t
->
assert
false
let
iprof
=
let
res
=
ref
[]
in
for
k
=
i
downto
1
do
res
:=
(
"x"
^
(
string_of_int
k
)
,
t
)
::
!
res
;
done
;
!
res
in
let
array_type
=
Array
(
t
,
i
)
in
let
key_prof
=
(
List
.
map
snd
iprof
)
@
[
array_type
]
in
{
key
=
(
"Lustre::array"
,
key_prof
,
None
);
profile
=
(
iprof
,
[
"z"
,
array_type
]);
instances
=
[]
;
step
=
[
{
name
=
"step"
;
lxm
=
Lxm
.
dummy
"predef array soc"
;
idx_ins
=
gen_index_list
i
;
idx_outs
=
[
0
];
impl
=
None
;
};
];
precedences
=
[]
;
have_mem
=
None
;
}
let
make_hat_soc
:
int
->
Soc
.
var_type
->
Soc
.
t
=
fun
i
t
->
...
...
@@ -506,10 +539,9 @@ let (soc_interface_of_pos_op:
(
make_hat_soc
i
elt_type
)
|
Lic
.
ARRAY
,
_
->
let
concrete_type
=
List
.
nth
types
0
in
let
soc
=
of_soc_key
((
"Lustre::array"
)
,
types
@
[
concrete_type
]
,
None
)
in
let
soc
=
instanciate_soc
soc
concrete_type
in
soc
let
elt_type
=
List
.
nth
types
0
in
let
i
=
(
List
.
length
types
)
in
(
make_array_soc
i
elt_type
)
|
Lic
.
CONCAT
,_->
finish_me
lxm
;
assert
false
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment