diff options
author | Sunil Shetye | 2018-07-12 23:16:08 +0530 |
---|---|---|
committer | Sunil Shetye | 2018-07-13 10:21:08 +0530 |
commit | 214ade87a6cef2bf55f9b9f2848ffafc02f37f18 (patch) | |
tree | 50fdfe7b1e8850622825e362ca865be3f0911009 /js/IntegerOp | |
parent | a2bfd6050ab2b5b6bbede92393b1f61d4ecc25aa (diff) | |
download | sci2js-214ade87a6cef2bf55f9b9f2848ffafc02f37f18.tar.gz sci2js-214ade87a6cef2bf55f9b9f2848ffafc02f37f18.tar.bz2 sci2js-214ade87a6cef2bf55f9b9f2848ffafc02f37f18.zip |
add more global variables
Diffstat (limited to 'js/IntegerOp')
-rw-r--r-- | js/IntegerOp/BITCLEAR.js | 13 | ||||
-rw-r--r-- | js/IntegerOp/BITCLEAR.pickle | 16 | ||||
-rw-r--r-- | js/IntegerOp/BITSET.js | 13 | ||||
-rw-r--r-- | js/IntegerOp/BITSET.pickle | 16 | ||||
-rw-r--r-- | js/IntegerOp/CONVERT.js | 13 | ||||
-rw-r--r-- | js/IntegerOp/CONVERT.pickle | 18 | ||||
-rw-r--r-- | js/IntegerOp/DFLIPFLOP.js | 4 | ||||
-rw-r--r-- | js/IntegerOp/DFLIPFLOP.pickle | 10 | ||||
-rw-r--r-- | js/IntegerOp/DLATCH.js | 4 | ||||
-rw-r--r-- | js/IntegerOp/DLATCH.pickle | 10 | ||||
-rw-r--r-- | js/IntegerOp/EXTRACTBITS.js | 13 | ||||
-rw-r--r-- | js/IntegerOp/EXTRACTBITS.pickle | 16 | ||||
-rw-r--r-- | js/IntegerOp/INTMUL.js | 13 | ||||
-rw-r--r-- | js/IntegerOp/INTMUL.pickle | 16 | ||||
-rw-r--r-- | js/IntegerOp/JKFLIPFLOP.js | 8 | ||||
-rw-r--r-- | js/IntegerOp/JKFLIPFLOP.pickle | 16 | ||||
-rw-r--r-- | js/IntegerOp/LOGIC.js | 13 | ||||
-rw-r--r-- | js/IntegerOp/LOGIC.pickle | 16 | ||||
-rw-r--r-- | js/IntegerOp/SHIFT.js | 13 | ||||
-rw-r--r-- | js/IntegerOp/SHIFT.pickle | 16 | ||||
-rw-r--r-- | js/IntegerOp/SRFLIPFLOP.js | 8 | ||||
-rw-r--r-- | js/IntegerOp/SRFLIPFLOP.pickle | 16 |
22 files changed, 170 insertions, 111 deletions
diff --git a/js/IntegerOp/BITCLEAR.js b/js/IntegerOp/BITCLEAR.js index 550671b5..0b74931f 100644 --- a/js/IntegerOp/BITCLEAR.js +++ b/js/IntegerOp/BITCLEAR.js @@ -12,9 +12,9 @@ function BITCLEAR() { this.model.opar = list(new ScilabDouble([int32(0)])); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = new ScilabDouble([true,false]); - var exprs = [[sci2exp(3)],[sci2exp(0)]]; - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"BITCLEAR\",sz(1),sz(2));"]); - this.x = standard_define([4,2],this.model,exprs,gr_i); + this.exprs = [[sci2exp(3)],[sci2exp(0)]]; + this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"BITCLEAR\",sz(1),sz(2));"]); + this.x = standard_define([4,2],this.model,this.exprs,this.gr_i); return new BasicBlock(this.x); } BITCLEAR.prototype.details = function BITCLEAR() { @@ -30,12 +30,13 @@ function BITCLEAR() { BITCLEAR.prototype.set = function BITCLEAR() { this.Datatype = arguments[0]["Datatype"] this.bit = parseFloat(arguments[0]["bit"]) + this.exprs = arguments[0]["exprs"] this.x = arg1; this.graphics = arg1.graphics; - var exprs = this.graphics.exprs; + this.exprs = this.graphics.exprs; this.model = arg1.model; while (true) { - [ok,this.Datatype,this.bit,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","BITCLEAR")],[" "],["Clear a bit"],[" "]],[msprintf("Data Type %s","(3:int32, 4:int16, 5:int8, ...)"),"Index of Bit (0 is least significant)"],list("vec",1,"vec",1),exprs); + [ok,this.Datatype,this.bit,this.exprs] = scicos_getvalue([[msprintf("Set %s block parameters","BITCLEAR")],[" "],["Clear a bit"],[" "]],[msprintf("Data Type %s","(3:int32, 4:int16, 5:int8, ...)"),"Index of Bit (0 is least significant)"],list("vec",1,"vec",1),this.exprs); if (!ok) { break; } @@ -87,7 +88,7 @@ function BITCLEAR() { var ok = tmpvar0[2]; } if (ok) { - this.graphics.exprs = new ScilabDouble([exprs]); + this.graphics.exprs = new ScilabDouble([this.exprs]); this.model.opar = list(new ScilabDouble([n])); this.x.graphics = this.graphics; this.x.model = this.model; diff --git a/js/IntegerOp/BITCLEAR.pickle b/js/IntegerOp/BITCLEAR.pickle index 24c58589..c8ab7e1e 100644 --- a/js/IntegerOp/BITCLEAR.pickle +++ b/js/IntegerOp/BITCLEAR.pickle @@ -4,16 +4,20 @@ p0 ((lp1 S'Datatype' p2 -aS'x' +aS'exprs' p3 -aS'model' +aS'gr_i' p4 -aS'bit' -p5 aS'graphics' +p5 +aS'x' p6 -atp7 -Rp8 +aS'model' +p7 +aS'bit' +p8 +atp9 +Rp10 .(dp0 S'arg1' p1 diff --git a/js/IntegerOp/BITSET.js b/js/IntegerOp/BITSET.js index bee59f69..920214d1 100644 --- a/js/IntegerOp/BITSET.js +++ b/js/IntegerOp/BITSET.js @@ -12,9 +12,9 @@ function BITSET() { this.model.opar = list(new ScilabDouble([uint32(0)])); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = new ScilabDouble([true,false]); - var exprs = [[sci2exp(3)],[sci2exp(0)]]; - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"BITSET\",sz(1),sz(2));"]); - this.x = standard_define([4,2],this.model,exprs,gr_i); + this.exprs = [[sci2exp(3)],[sci2exp(0)]]; + this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"BITSET\",sz(1),sz(2));"]); + this.x = standard_define([4,2],this.model,this.exprs,this.gr_i); return new BasicBlock(this.x); } BITSET.prototype.details = function BITSET() { @@ -30,12 +30,13 @@ function BITSET() { BITSET.prototype.set = function BITSET() { this.Datatype = arguments[0]["Datatype"] this.bit = parseFloat(arguments[0]["bit"]) + this.exprs = arguments[0]["exprs"] this.x = arg1; this.graphics = arg1.graphics; - var exprs = this.graphics.exprs; + this.exprs = this.graphics.exprs; this.model = arg1.model; while (true) { - [ok,this.Datatype,this.bit,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","BITSET")],[" "],["Set a bit"],[" "]],[msprintf("Data Type %s","(3:int32, 4:int16, 5:int8, ...)"),"Index of Bit (0 is least significant)"],list("vec",1,"vec",1),exprs); + [ok,this.Datatype,this.bit,this.exprs] = scicos_getvalue([[msprintf("Set %s block parameters","BITSET")],[" "],["Set a bit"],[" "]],[msprintf("Data Type %s","(3:int32, 4:int16, 5:int8, ...)"),"Index of Bit (0 is least significant)"],list("vec",1,"vec",1),this.exprs); if (!ok) { break; } @@ -85,7 +86,7 @@ function BITSET() { var ok = tmpvar0[2]; } if (ok) { - this.graphics.exprs = new ScilabDouble([exprs]); + this.graphics.exprs = new ScilabDouble([this.exprs]); this.model.opar = list(new ScilabDouble([n])); this.x.graphics = this.graphics; this.x.model = this.model; diff --git a/js/IntegerOp/BITSET.pickle b/js/IntegerOp/BITSET.pickle index 24c58589..c8ab7e1e 100644 --- a/js/IntegerOp/BITSET.pickle +++ b/js/IntegerOp/BITSET.pickle @@ -4,16 +4,20 @@ p0 ((lp1 S'Datatype' p2 -aS'x' +aS'exprs' p3 -aS'model' +aS'gr_i' p4 -aS'bit' -p5 aS'graphics' +p5 +aS'x' p6 -atp7 -Rp8 +aS'model' +p7 +aS'bit' +p8 +atp9 +Rp10 .(dp0 S'arg1' p1 diff --git a/js/IntegerOp/CONVERT.js b/js/IntegerOp/CONVERT.js index dab0ab34..205bf88a 100644 --- a/js/IntegerOp/CONVERT.js +++ b/js/IntegerOp/CONVERT.js @@ -14,9 +14,9 @@ function CONVERT() { this.model.ipar = new ScilabDouble([sgn]); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = new ScilabDouble([true,false]); - var exprs = [[sci2exp(1)],[sci2exp(3)],[sci2exp(0)]]; - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"CONVERT\",sz(1),sz(2));"]); - this.x = standard_define([3,2],this.model,exprs,gr_i); + this.exprs = [[sci2exp(1)],[sci2exp(3)],[sci2exp(0)]]; + this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"CONVERT\",sz(1),sz(2));"]); + this.x = standard_define([3,2],this.model,this.exprs,this.gr_i); return new BasicBlock(this.x); } CONVERT.prototype.details = function CONVERT() { @@ -34,12 +34,13 @@ function CONVERT() { this.it = parseFloat(arguments[0]["it"]) this.ot = parseFloat(arguments[0]["ot"]) this.np = arguments[0]["np"] + this.exprs = arguments[0]["exprs"] this.x = arg1; this.graphics = arg1.graphics; this.model = arg1.model; - var exprs = this.graphics.exprs; + this.exprs = this.graphics.exprs; while (true) { - [ok,this.it,this.ot,this.np,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","CONVERT")],[" "],["Type conversion"],[" "]],["Input Type (1:double, 3:int32, 4:int16, 5:int8, ...)","Output Type (1:double, 3:int32, 4:int16, 5:int8, ...)","Do on Overflow (0:Nothing, 1:Saturate, 2:Error)"],list("vec",1,"vec",1,"vec",1),exprs); + [ok,this.it,this.ot,this.np,this.exprs] = scicos_getvalue([[msprintf("Set %s block parameters","CONVERT")],[" "],["Type conversion"],[" "]],["Input Type (1:double, 3:int32, 4:int16, 5:int8, ...)","Output Type (1:double, 3:int32, 4:int16, 5:int8, ...)","Do on Overflow (0:Nothing, 1:Saturate, 2:Error)"],list("vec",1,"vec",1,"vec",1),this.exprs); if (!ok) { break; } @@ -374,7 +375,7 @@ function CONVERT() { var ok = tmpvar0[2]; } if (ok) { - this.graphics.exprs = new ScilabDouble([exprs]); + this.graphics.exprs = new ScilabDouble([this.exprs]); this.x.graphics = this.graphics; this.x.model = this.model; break; diff --git a/js/IntegerOp/CONVERT.pickle b/js/IntegerOp/CONVERT.pickle index 7e1aaf37..aaa410ba 100644 --- a/js/IntegerOp/CONVERT.pickle +++ b/js/IntegerOp/CONVERT.pickle @@ -4,18 +4,22 @@ p0 ((lp1 S'it' p2 -aS'graphics' +aS'exprs' p3 -aS'np' +aS'gr_i' p4 -aS'x' +aS'graphics' p5 -aS'model' +aS'np' p6 -aS'ot' +aS'x' p7 -atp8 -Rp9 +aS'model' +p8 +aS'ot' +p9 +atp10 +Rp11 .(dp0 S'arg1' p1 diff --git a/js/IntegerOp/DFLIPFLOP.js b/js/IntegerOp/DFLIPFLOP.js index bf597aee..da878654 100644 --- a/js/IntegerOp/DFLIPFLOP.js +++ b/js/IntegerOp/DFLIPFLOP.js @@ -88,8 +88,8 @@ function DFLIPFLOP() { this.model.firing = new ScilabBoolean([false]); this.model.dep_ut = new ScilabDouble([true,false]); this.model.rpar = new ScilabDouble([scs_m]); - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"DFLIPFLOP\",sz(1),sz(2));"]); - this.x = standard_define([2,3],this.model,[],gr_i); + this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"DFLIPFLOP\",sz(1),sz(2));"]); + this.x = standard_define([2,3],this.model,[],this.gr_i); return new BasicBlock(this.x); } DFLIPFLOP.prototype.details = function DFLIPFLOP() { diff --git a/js/IntegerOp/DFLIPFLOP.pickle b/js/IntegerOp/DFLIPFLOP.pickle index f92835f1..37018580 100644 --- a/js/IntegerOp/DFLIPFLOP.pickle +++ b/js/IntegerOp/DFLIPFLOP.pickle @@ -6,8 +6,14 @@ S'x' p2 aS'model' p3 -atp4 -Rp5 +aS'gr_i' +p4 +aS'exprs' +p5 +aS'graphics' +p6 +atp7 +Rp8 .(dp0 S'scs_m_1.objs[9-1]' p1 diff --git a/js/IntegerOp/DLATCH.js b/js/IntegerOp/DLATCH.js index 8dde9f63..e9df7061 100644 --- a/js/IntegerOp/DLATCH.js +++ b/js/IntegerOp/DLATCH.js @@ -33,8 +33,8 @@ function DLATCH() { this.model.firing = new ScilabBoolean([false]); this.model.dep_ut = new ScilabDouble([true,false]); this.model.rpar = new ScilabDouble([scs_m]); - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"DLATCH\",sz(1),sz(2));"]); - this.x = standard_define([2,3],this.model,[],gr_i); + this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"DLATCH\",sz(1),sz(2));"]); + this.x = standard_define([2,3],this.model,[],this.gr_i); return new BasicBlock(this.x); } DLATCH.prototype.details = function DLATCH() { diff --git a/js/IntegerOp/DLATCH.pickle b/js/IntegerOp/DLATCH.pickle index 06eaaaef..214e0a39 100644 --- a/js/IntegerOp/DLATCH.pickle +++ b/js/IntegerOp/DLATCH.pickle @@ -6,8 +6,14 @@ S'x' p2 aS'model' p3 -atp4 -Rp5 +aS'gr_i' +p4 +aS'exprs' +p5 +aS'graphics' +p6 +atp7 +Rp8 .(dp0 S'model.sim' p1 diff --git a/js/IntegerOp/EXTRACTBITS.js b/js/IntegerOp/EXTRACTBITS.js index 73d29d70..20f3fd8a 100644 --- a/js/IntegerOp/EXTRACTBITS.js +++ b/js/IntegerOp/EXTRACTBITS.js @@ -13,9 +13,9 @@ function EXTRACTBITS() { this.model.ipar = new ScilabDouble([0,numb]); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = new ScilabDouble([true,false]); - var exprs = [[sci2exp(3)],[sci2exp(1)],[sci2exp(0)],[sci2exp(0)]]; - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"EXTRACTBITS\",sz(1),sz(2));"]); - this.x = standard_define([4,2],this.model,exprs,gr_i); + this.exprs = [[sci2exp(3)],[sci2exp(1)],[sci2exp(0)],[sci2exp(0)]]; + this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"EXTRACTBITS\",sz(1),sz(2));"]); + this.x = standard_define([4,2],this.model,this.exprs,this.gr_i); return new BasicBlock(this.x); } EXTRACTBITS.prototype.details = function EXTRACTBITS() { @@ -35,12 +35,13 @@ function EXTRACTBITS() { this.rule = parseFloat(arguments[0]["rule"]) this.bit = parseFloat(arguments[0]["bit"]) this.scal = arguments[0]["scal"] + this.exprs = arguments[0]["exprs"] this.x = arg1; this.graphics = arg1.graphics; - var exprs = this.graphics.exprs; + this.exprs = this.graphics.exprs; this.model = arg1.model; while (true) { - [ok,this.Datatype,this.rule,this.bit,this.scal,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","EXTRACTBITS")],[" "],["Bits Extraction"],[" "],[" - Bits to Extract:"],[" 1 Upper Half"],[" 2 Lower Half"],[" 3 Range from MSB"],[" 4 Range to LSB"],[" 5 Range of Bits"],[" - Number of Bits or Index of bit : Index 0 is LSB"],[" If \'Bits to Extract\' is set to \'Range of bits\': [Start, End]"],[" "]],[msprintf("Data Type %s","(3:int32, 4:int16, 5:int8, ...)"),"Bits to extract","Number of Bits or Index of Bit","Treat Bit Field as an Integer (0:No, 1:Yes)"],list("vec",1,"vec",1,"vec",-1,"vec",1),exprs); + [ok,this.Datatype,this.rule,this.bit,this.scal,this.exprs] = scicos_getvalue([[msprintf("Set %s block parameters","EXTRACTBITS")],[" "],["Bits Extraction"],[" "],[" - Bits to Extract:"],[" 1 Upper Half"],[" 2 Lower Half"],[" 3 Range from MSB"],[" 4 Range to LSB"],[" 5 Range of Bits"],[" - Number of Bits or Index of bit : Index 0 is LSB"],[" If \'Bits to Extract\' is set to \'Range of bits\': [Start, End]"],[" "]],[msprintf("Data Type %s","(3:int32, 4:int16, 5:int8, ...)"),"Bits to extract","Number of Bits or Index of Bit","Treat Bit Field as an Integer (0:No, 1:Yes)"],list("vec",1,"vec",1,"vec",-1,"vec",1),this.exprs); if (!ok) { break; } @@ -234,7 +235,7 @@ function EXTRACTBITS() { var ok = tmpvar0[2]; } if (ok) { - this.graphics.exprs = new ScilabDouble([exprs]); + this.graphics.exprs = new ScilabDouble([this.exprs]); this.model.ipar = new ScilabDouble([int(this.bit.slice())],[int(numb.slice())]); this.x.graphics = this.graphics; this.x.model = this.model; diff --git a/js/IntegerOp/EXTRACTBITS.pickle b/js/IntegerOp/EXTRACTBITS.pickle index c47eb37f..e9c13a5f 100644 --- a/js/IntegerOp/EXTRACTBITS.pickle +++ b/js/IntegerOp/EXTRACTBITS.pickle @@ -8,16 +8,20 @@ aS'Datatype' p3 aS'rule' p4 -aS'graphics' +aS'exprs' p5 -aS'x' +aS'gr_i' p6 -aS'model' +aS'graphics' p7 -aS'bit' +aS'x' p8 -atp9 -Rp10 +aS'model' +p9 +aS'bit' +p10 +atp11 +Rp12 .(dp0 S'arg1' p1 diff --git a/js/IntegerOp/INTMUL.js b/js/IntegerOp/INTMUL.js index 56a654ff..c0f32924 100644 --- a/js/IntegerOp/INTMUL.js +++ b/js/IntegerOp/INTMUL.js @@ -14,9 +14,9 @@ function INTMUL() { this.model.ipar = new ScilabDouble([sgn]); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = new ScilabDouble([true,false]); - var exprs = [[sci2exp(3)],[sci2exp(0)]]; - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"INTMUL\",sz(1),sz(2));"]); - this.x = standard_define([2,2],this.model,exprs,gr_i); + this.exprs = [[sci2exp(3)],[sci2exp(0)]]; + this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"INTMUL\",sz(1),sz(2));"]); + this.x = standard_define([2,2],this.model,this.exprs,this.gr_i); return new BasicBlock(this.x); } INTMUL.prototype.details = function INTMUL() { @@ -32,12 +32,13 @@ function INTMUL() { INTMUL.prototype.set = function INTMUL() { this.Datatype = arguments[0]["Datatype"] this.np = arguments[0]["np"] + this.exprs = arguments[0]["exprs"] this.x = arg1; this.graphics = arg1.graphics; this.model = arg1.model; - var exprs = this.graphics.exprs; + this.exprs = this.graphics.exprs; while (true) { - [ok,this.Datatype,this.np,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","INTMUL")],[" "],["Integer matrix multiplication"],[" "]],[msprintf("Data Type %s","(3:int32, 4:int16, 5:int8, ...)"),"Do on Overflow (0:Nothing, 1:Saturate, 2:Error)"],list("vec",1,"vec",1),exprs); + [ok,this.Datatype,this.np,this.exprs] = scicos_getvalue([[msprintf("Set %s block parameters","INTMUL")],[" "],["Integer matrix multiplication"],[" "]],[msprintf("Data Type %s","(3:int32, 4:int16, 5:int8, ...)"),"Do on Overflow (0:Nothing, 1:Saturate, 2:Error)"],list("vec",1,"vec",1),this.exprs); if (!ok) { break; } @@ -108,7 +109,7 @@ function INTMUL() { } if (ok) { this.model.ipar = new ScilabDouble([this.np]); - this.graphics.exprs = new ScilabDouble([exprs]); + this.graphics.exprs = new ScilabDouble([this.exprs]); this.x.graphics = this.graphics; this.x.model = this.model; break; diff --git a/js/IntegerOp/INTMUL.pickle b/js/IntegerOp/INTMUL.pickle index 187761c9..28173e09 100644 --- a/js/IntegerOp/INTMUL.pickle +++ b/js/IntegerOp/INTMUL.pickle @@ -4,16 +4,20 @@ p0 ((lp1 S'Datatype' p2 -aS'x' +aS'exprs' p3 -aS'model' +aS'gr_i' p4 -aS'np' -p5 aS'graphics' +p5 +aS'np' p6 -atp7 -Rp8 +aS'x' +p7 +aS'model' +p8 +atp9 +Rp10 .(dp0 S'arg1' p1 diff --git a/js/IntegerOp/JKFLIPFLOP.js b/js/IntegerOp/JKFLIPFLOP.js index 1fb25113..ddd251c0 100644 --- a/js/IntegerOp/JKFLIPFLOP.js +++ b/js/IntegerOp/JKFLIPFLOP.js @@ -44,8 +44,8 @@ function JKFLIPFLOP() { this.model.firing = new ScilabBoolean([false]); this.model.dep_ut = new ScilabDouble([true,false]); this.model.rpar = new ScilabDouble([scs_m]); - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"JKFLIPFLOP\",sz(1),sz(2));"]); - this.x = standard_define([2,3],this.model,[],gr_i); + this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"JKFLIPFLOP\",sz(1),sz(2));"]); + this.x = standard_define([2,3],this.model,[],this.gr_i); return new BasicBlock(this.x); } JKFLIPFLOP.prototype.details = function JKFLIPFLOP() { @@ -68,11 +68,11 @@ function JKFLIPFLOP() { } var newpar = list(); var xx = arg1.model.rpar.objs[path-1]; - var exprs = xx.graphics.exprs[1-1]; + this.exprs = xx.graphics.exprs[1-1]; this.model = xx.model; var init_old = this.model.odstate[1-1]; while (true) { - [ok,this.init,this.exprs0] = scicos_getvalue([[msprintf("Set %s block parameters","JKFLIPFLOP")],[" "],["JK flip-flop"],[" "],["The \'Initial Value\' must be 0 or 1 of type int8"],[" - Negative values are considered as int8(0)"],[" - Positive values are considered as int8(1)"],[" "]],"Initial Value",list("vec",1),exprs); + [ok,this.init,this.exprs0] = scicos_getvalue([[msprintf("Set %s block parameters","JKFLIPFLOP")],[" "],["JK flip-flop"],[" "],["The \'Initial Value\' must be 0 or 1 of type int8"],[" - Negative values are considered as int8(0)"],[" - Positive values are considered as int8(1)"],[" "]],"Initial Value",list("vec",1),this.exprs); if (!ok) { break; } diff --git a/js/IntegerOp/JKFLIPFLOP.pickle b/js/IntegerOp/JKFLIPFLOP.pickle index 29deca35..f81681e8 100644 --- a/js/IntegerOp/JKFLIPFLOP.pickle +++ b/js/IntegerOp/JKFLIPFLOP.pickle @@ -2,16 +2,22 @@ c__builtin__ set p0 ((lp1 -S'x' +S'exprs0' p2 -aS'model' +aS'exprs' p3 aS'init' p4 -aS'exprs0' +aS'gr_i' p5 -atp6 -Rp7 +aS'graphics' +p6 +aS'x' +p7 +aS'model' +p8 +atp9 +Rp10 .(dp0 S'xx.model' p1 diff --git a/js/IntegerOp/LOGIC.js b/js/IntegerOp/LOGIC.js index 4f2013b8..7a463e3c 100644 --- a/js/IntegerOp/LOGIC.js +++ b/js/IntegerOp/LOGIC.js @@ -15,9 +15,9 @@ function LOGIC() { this.model.blocktype = new ScilabString(["c"]); this.model.firing = new ScilabBoolean([false]); this.model.dep_ut = new ScilabDouble([true,false]); - var exprs = [[sci2exp(this.mat)],[sci2exp(0)]]; - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"LOGIC\",sz(1),sz(2));"]); - this.x = standard_define([2,2],this.model,exprs,gr_i); + this.exprs = [[sci2exp(this.mat)],[sci2exp(0)]]; + this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"LOGIC\",sz(1),sz(2));"]); + this.x = standard_define([2,2],this.model,this.exprs,this.gr_i); return new BasicBlock(this.x); } LOGIC.prototype.details = function LOGIC() { @@ -33,12 +33,13 @@ function LOGIC() { LOGIC.prototype.set = function LOGIC() { this.mat = inverse(arguments[0]["mat"]) this.herit = arguments[0]["herit"] + this.exprs = arguments[0]["exprs"] this.x = arg1; this.graphics = arg1.graphics; - var exprs = this.graphics.exprs; + this.exprs = this.graphics.exprs; this.model = arg1.model; while (true) { - [ok,this.mat,this.herit,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","LOGIC")],[" "],["Combinatorial logic"],[" "],[" Rows of the matrix are the output values"],[" Number of rows must be a power of two."],[" Number of columns gives the number of outputs."],[" "]],["Truth Table (matrix of outputs)","Accepts Inherited Events (0:No, 1:Yes)"],list("mat",[-1,-2],"vec",1),exprs); + [ok,this.mat,this.herit,this.exprs] = scicos_getvalue([[msprintf("Set %s block parameters","LOGIC")],[" "],["Combinatorial logic"],[" "],[" Rows of the matrix are the output values"],[" Number of rows must be a power of two."],[" Number of columns gives the number of outputs."],[" "]],["Truth Table (matrix of outputs)","Accepts Inherited Events (0:No, 1:Yes)"],list("mat",[-1,-2],"vec",1),this.exprs); if (!ok) { break; } @@ -66,7 +67,7 @@ function LOGIC() { var ok = tmpvar0[2]; } if (ok) { - this.graphics.exprs = new ScilabDouble([exprs]); + this.graphics.exprs = new ScilabDouble([this.exprs]); this.mat = int8(this.mat); this.model.opar = list(new ScilabDouble([this.mat])); this.x.graphics = this.graphics; diff --git a/js/IntegerOp/LOGIC.pickle b/js/IntegerOp/LOGIC.pickle index c2e52def..a7b30e2e 100644 --- a/js/IntegerOp/LOGIC.pickle +++ b/js/IntegerOp/LOGIC.pickle @@ -2,18 +2,22 @@ c__builtin__ set p0 ((lp1 -S'x' +S'herit' p2 -aS'model' +aS'mat' p3 -aS'herit' +aS'exprs' p4 -aS'mat' +aS'gr_i' p5 aS'graphics' p6 -atp7 -Rp8 +aS'x' +p7 +aS'model' +p8 +atp9 +Rp10 .(dp0 S'arg1' p1 diff --git a/js/IntegerOp/SHIFT.js b/js/IntegerOp/SHIFT.js index f7204135..d80d4c1f 100644 --- a/js/IntegerOp/SHIFT.js +++ b/js/IntegerOp/SHIFT.js @@ -15,9 +15,9 @@ function SHIFT() { this.model.ipar = new ScilabDouble(sgn); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = new ScilabDouble([true,false]); - var exprs = [[sci2exp(3)],[sci2exp(0)],[sci2exp(0)]]; - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"SHIFT\",sz(1),sz(2));"]); - this.x = standard_define([3,2],this.model,exprs,gr_i); + this.exprs = [[sci2exp(3)],[sci2exp(0)],[sci2exp(0)]]; + this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"SHIFT\",sz(1),sz(2));"]); + this.x = standard_define([3,2],this.model,this.exprs,this.gr_i); return new BasicBlock(this.x); } SHIFT.prototype.details = function SHIFT() { @@ -35,12 +35,13 @@ function SHIFT() { this.Datatype = arguments[0]["Datatype"] this.nb = arguments[0]["nb"] this.np = arguments[0]["np"] + this.exprs = arguments[0]["exprs"] this.x = arg1; this.graphics = arg1.graphics; this.model = arg1.model; - var exprs = this.graphics.exprs; + this.exprs = this.graphics.exprs; while (true) { - [ok,this.Datatype,this.nb,this.np,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","SHIFT")],[" "],["Shift/Rotates bits"]],[msprintf("Data Type %s","(3:int32, 4:int16, 5:int8, ...)"),"Number of Bits to Shift Left (Negative number to shift right)","Shift Type (0:Arithmetic, 1:Circular)"],list("vec",1,"vec",1,"vec",1),exprs); + [ok,this.Datatype,this.nb,this.np,this.exprs] = scicos_getvalue([[msprintf("Set %s block parameters","SHIFT")],[" "],["Shift/Rotates bits"]],[msprintf("Data Type %s","(3:int32, 4:int16, 5:int8, ...)"),"Number of Bits to Shift Left (Negative number to shift right)","Shift Type (0:Arithmetic, 1:Circular)"],list("vec",1,"vec",1,"vec",1),this.exprs); if (!ok) { break; } @@ -125,7 +126,7 @@ function SHIFT() { } if (ok) { this.model.ipar = new ScilabDouble([this.nb]); - this.graphics.exprs = new ScilabDouble([exprs]); + this.graphics.exprs = new ScilabDouble([this.exprs]); this.x.graphics = this.graphics; this.x.model = this.model; break; diff --git a/js/IntegerOp/SHIFT.pickle b/js/IntegerOp/SHIFT.pickle index c5cb2ddf..10f24435 100644 --- a/js/IntegerOp/SHIFT.pickle +++ b/js/IntegerOp/SHIFT.pickle @@ -6,16 +6,20 @@ S'Datatype' p2 aS'nb' p3 -aS'graphics' +aS'exprs' p4 -aS'np' +aS'gr_i' p5 -aS'x' +aS'graphics' p6 -aS'model' +aS'np' p7 -atp8 -Rp9 +aS'x' +p8 +aS'model' +p9 +atp10 +Rp11 .(dp0 S'OPER' p1 diff --git a/js/IntegerOp/SRFLIPFLOP.js b/js/IntegerOp/SRFLIPFLOP.js index 99b49370..fd9a0e51 100644 --- a/js/IntegerOp/SRFLIPFLOP.js +++ b/js/IntegerOp/SRFLIPFLOP.js @@ -28,8 +28,8 @@ function SRFLIPFLOP() { this.model.firing = new ScilabBoolean([false]); this.model.dep_ut = new ScilabDouble([true,false]); this.model.rpar = new ScilabDouble([scs_m]); - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"SRFLIPFLOP\",sz(1),sz(2));"]); - this.x = standard_define([2,3],this.model,[],gr_i); + this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"SRFLIPFLOP\",sz(1),sz(2));"]); + this.x = standard_define([2,3],this.model,[],this.gr_i); return new BasicBlock(this.x); } SRFLIPFLOP.prototype.details = function SRFLIPFLOP() { @@ -52,11 +52,11 @@ function SRFLIPFLOP() { } var newpar = list(); var xx = arg1.model.rpar.objs[path-1]; - var exprs = xx.graphics.exprs[1-1]; + this.exprs = xx.graphics.exprs[1-1]; this.model = xx.model; var init_old = this.model.odstate[1-1]; while (true) { - [ok,this.init,this.exprs0] = scicos_getvalue([[msprintf("Set %s block parameters","SRFLIPFLOP")],[" "],["SR flip-flop"],[" "],["The \'Initial Value\' must be 0 or 1 of type int8"],[" - Negative values are considered as int8(0)"],[" - Positive values are considered as int8(1)"],[" "]],"Initial Value",list("vec",1),exprs); + [ok,this.init,this.exprs0] = scicos_getvalue([[msprintf("Set %s block parameters","SRFLIPFLOP")],[" "],["SR flip-flop"],[" "],["The \'Initial Value\' must be 0 or 1 of type int8"],[" - Negative values are considered as int8(0)"],[" - Positive values are considered as int8(1)"],[" "]],"Initial Value",list("vec",1),this.exprs); if (!ok) { break; } diff --git a/js/IntegerOp/SRFLIPFLOP.pickle b/js/IntegerOp/SRFLIPFLOP.pickle index 4bf38a8b..4a6405ff 100644 --- a/js/IntegerOp/SRFLIPFLOP.pickle +++ b/js/IntegerOp/SRFLIPFLOP.pickle @@ -2,16 +2,22 @@ c__builtin__ set p0 ((lp1 -S'x' +S'exprs0' p2 -aS'model' +aS'exprs' p3 aS'init' p4 -aS'exprs0' +aS'gr_i' p5 -atp6 -Rp7 +aS'graphics' +p6 +aS'x' +p7 +aS'model' +p8 +atp9 +Rp10 .(dp0 S'xx.model' p1 |