Skip to content
Snippets Groups Projects
Commit 148595c1 authored by Erwan Jahier's avatar Erwan Jahier
Browse files

Merge remote-tracking branch...

Merge remote-tracking branch 'origin/6-can-not-iterate-over-the-plus-node-as-long-as-it-is-named-plus'
parents aad0759a ed439b11
No related branches found
No related tags found
No related merge requests found
......@@ -58,8 +58,10 @@ update_version:
git add src/lv6version.ml
make clean && make
BRANCH=$(shell git rev-parse --abbrev-ref HEAD)
cia:
test -f committed && \
test -f committed && \
echo "*** I won't commit!\n*** until you 'make update_version'!" \
|| (git commit -a -F log && touch committed) && echo "Hint: 'make ci' to test the CI before doing 'make 'push'"
......@@ -99,7 +101,7 @@ $(WWWTEST)/pool/$(PACKNAME).tgz: $(PACKNAME).tgz
opam : $(WWW)/pool/$(PACKNAME).tgz
test -f committed && ( \
[ $(BRANCH) = "master" ] && test -f committed && ( \
cd $(WWW)/opam-repository/packages && \
oasis2opam $(HTTP)/pool/$(PACKNAME).tgz && \
cp ~/lus2lic/opam $(OPAM_FILE) && \
......@@ -109,7 +111,7 @@ opam : $(WWW)/pool/$(PACKNAME).tgz
cp -rf $(OPAM_DIR) $(OFFICIAL_OPAM_DIR)
opam-test : $(WWWTEST)/pool/$(PACKNAME).tgz
cd $(WWWTEST)/opam-repository/packages && \
[ $(BRANCH) = "master" ] && cd $(WWWTEST)/opam-repository/packages && \
oasis2opam $(HTTPTEST)/pool/$(PACKNAME).tgz && \
cp ~/lus2lic/opam $(OPAM_FILE_TEST) && \
cd .. ; opam-admin check && opam-admin make -g
......
(** Time-stamp: <modified the 20/02/2017 (at 11:30) by Erwan Jahier> *)
(** Time-stamp: <modified the 04/07/2018 (at 09:59) by Erwan Jahier> *)
open Lxm
open Lic
......@@ -334,11 +334,12 @@ let (create_map_body: local_ctx -> Lic.static_arg list -> Lic.node_body * var_in
let cl =
List.map (fun l -> snd (Lic.var_info_of_left l).var_clock_eff) lhs
in
let p,n = fst iter_node.it in
let rhs = {
ve_typ = List.map Lic.type_of_left lhs;
ve_clk = cl;
ve_core =
if AstPredef.is_a_predef_op (snd(fst iter_node.it)) then
ve_core =
if p="Lustre" && AstPredef.is_a_predef_op n then
CallByPosLic({src=lxm;it=(Lic.PREDEF_CALL iter_node)}, xi_j)
else
CallByPosLic({src=lxm;it=(CALL iter_node)}, xi_j);
......
node O(x: bool) returns (y: bool);
let
y = false -> pre x; -- y = 0 x
tel
node I(x: bool) returns (y: bool);
let
y = true -> pre x; -- y = 1 x
tel
--node adder=plus;
node plus(x,y: bool) returns (s: bool);
var c: bool;
let
c = O(if c then (x or y) else (x and y));
s = c xor x xor y;
tel
node tabtimes<<const n: int; const dummy: bool>> (
xin, yin : bool
) returns (
z : bool
);
var
------------------
-- time :
-- T[i]_i = 1 T[i]_j = 0
T : bool^n;
------------------
-- x bits:
-- XB[i]_t = x_i if t >= i
-- = 0 else
------------------
XB : bool^n;
------------------
-- y window:
-- WY[i]_t = y_(t-i) si t >= i
-- = 0 sinon
WY : bool^n;
------------------
-- Sum arguments:
-- A[i]_t = if XB[i]_t then
-- WY[i]_t else false
A : bool^n;
------------------
-- Sum accumulator:
------------------
S : bool^n;
--APRES n ticks :
timeout : bool;
x, y : bool;
let
--input filtering:
--enforce 0 after timeout
x = xin and not timeout;
y = yin and not timeout;
T[0] = true -> false;
T[1..n-1] = false^(n-1) -> pre T[0..n-2];
timeout = (false -> pre timeout) or T[n-1];
--XB = if T then x^n else (false^n -> pre XB);
XB = map<<Lustre::if,n>>(T, x^n, map<<O,n>>(XB));
WY[0] = y;
WY[1..n-1] = false^(n-1) -> pre WY[0..n-2];
A = map<<Lustre::if,n>>(XB, WY, false^n);
S[0] = A[0];
--S[1..n-1] = map<<adder,n-1>>(S[0..n-2], A[1..n-1]);
S[1..n-1] = map<<plus,n-1>>(S[0..n-2], A[1..n-1]);
z = if timeout then dummy else S[n-1];
tel
node test = tabtimes<<4,false>>;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment