Removed unused 'job' and 'gr_i' values.
Change-Id: Ie73f9e53bde0dc2eed225ee9063a67eb3cc622fa
//
function [x,y,typ]=BITCLEAR(job,arg1,arg2)
- x=[];y=[];typ=[]
+ x=[];
+ y=[];
+ typ=[];
select job
- case "plot" then
- OPER=string( arg1.graphics.exprs(2))
- standard_draw(arg1)
- case "getinputs" then
- [x,y,typ]=standard_inputs(arg1)
- case "getoutputs" then
- [x,y,typ]=standard_outputs(arg1)
- case "getorigin" then
- [x,y]=standard_origin(arg1)
case "set" then
x=arg1;
- graphics=arg1.graphics;exprs=graphics.exprs
+ graphics=arg1.graphics;
+ exprs=graphics.exprs
model=arg1.model;
while %t do
[msprintf(gettext("Data Type %s"), "(3:int32, 4:int16, 5:int8, ...)"); gettext("Index of Bit (0 is least significant)")],..
list("vec",1,"vec",1), exprs);
- if ~ok then break,end
+ if ~ok then
+ break,
+ end
in=[model.in model.in2];
if floor(bit) <> bit then
if ok then
graphics.exprs=exprs;
model.opar=list(n)
- x.graphics=graphics;x.model=model;
+ x.graphics=graphics;
+ x.model=model;
break
end
end
model.dep_ut=[%t %f]
exprs=[sci2exp(3);sci2exp(0)]
- gr_i=["xstringb(orig(1),orig(2),[''Clear'';''bit: ''+OPER],sz(1),sz(2),''fill'');"]
+ gr_i=[]
x=standard_define([4 2],model,exprs,gr_i)
end
//
function [x,y,typ]=BITSET(job,arg1,arg2)
- x=[];y=[];typ=[]
+ x=[];
+ y=[];
+ typ=[];
select job
- case "plot" then
- OPER=string( arg1.graphics.exprs(2))
- standard_draw(arg1)
- case "getinputs" then
- [x,y,typ]=standard_inputs(arg1)
- case "getoutputs" then
- [x,y,typ]=standard_outputs(arg1)
- case "getorigin" then
- [x,y]=standard_origin(arg1)
case "set" then
x=arg1;
- graphics=arg1.graphics;exprs=graphics.exprs
+ graphics=arg1.graphics;
+ exprs=graphics.exprs
model=arg1.model;
while %t do
[ok,Datatype,bit,exprs]=scicos_getvalue([msprintf(gettext("Set %s block parameters"), "BITSET");" "; gettext("Set a bit");" "],..
[msprintf(gettext("Data Type %s"), "(3:int32, 4:int16, 5:int8, ...)"); gettext("Index of Bit (0 is least significant)")],..
list("vec",1,"vec",1), exprs);
- if ~ok then break,end
+ if ~ok then
+ break,
+ end
in=[model.in model.in2];
if floor(bit) <> bit then
if ok then
graphics.exprs=exprs;
model.opar=list(n);
- x.graphics=graphics;x.model=model;
+ x.graphics=graphics;
+ x.model=model;
break
end
end
model.dep_ut=[%t %f]
exprs=[sci2exp(3);sci2exp(0)]
- gr_i=["xstringb(orig(1),orig(2),['' Set'';''bit: ''+OPER],sz(1),sz(2),''fill'');"]
+ gr_i=[]
x=standard_define([4 2],model,exprs,gr_i)
end
//
function [x,y,typ]=CONVERT(job,arg1,arg2)
- x=[];y=[];typ=[];
+ x=[];
+ y=[];
+ typ=[];
select job
- case "plot" then
- sgn=arg1.model.ipar
- VOP=[" double "," double "," int32 "," int16 ",...
- " int8 "," uint32 "," uint16 "," uint8 "]
- OPER=VOP(evstr( arg1.graphics.exprs(2)))
- standard_draw(arg1)
- case "getinputs" then
- [x,y,typ]=standard_inputs(arg1)
- case "getoutputs" then
- [x,y,typ]=standard_outputs(arg1)
- case "getorigin" then
- [x,y]=standard_origin(arg1)
case "set" then
x=arg1;
graphics=arg1.graphics
[gettext("Input Type (1:double, 3:int32, 4:int16, 5:int8, ...)"); gettext("Output Type (1:double, 3:int32, 4:int16, 5:int8, ...)"); ..
gettext("Do on Overflow (0:Nothing, 1:Saturate, 2:Error)")], ..
list("vec",1,"vec",1,"vec",1), exprs);
- if ~ok then break,end
+ if ~ok then
+ break,
+ end
- if it==2 then it =1;end
- if ot==2 then ot=1;end
+ if it==2 then
+ it =1;
+ end
+ if ot==2 then
+ ot=1;
+ end
if (np ~= 0 & np ~= 1 & np ~= 2) then
block_parameter_error(msprintf(gettext("Wrong value for ''%s'' parameter: %d."), gettext("Do on Overflow"), np), ..
else
if (np==0) then
if (it==1) then
- if (ot==3) then model.ipar=2;
- elseif (ot==4) then model.ipar=3;
- elseif (ot==5) then model.ipar=4;
- elseif (ot==6) then model.ipar=5;
- elseif (ot==7) then model.ipar=6;
- elseif (ot==8) then model.ipar=7;
+ if (ot==3) then
+ model.ipar=2;
+ elseif (ot==4) then
+ model.ipar=3;
+ elseif (ot==5) then
+ model.ipar=4;
+ elseif (ot==6) then
+ model.ipar=5;
+ elseif (ot==7) then
+ model.ipar=6;
+ elseif (ot==8) then
+ model.ipar=7;
end
elseif (it==3) then
- if (ot==1) then model.ipar=8;
- elseif (ot==4) then model.ipar=9;
- elseif (ot==5) then model.ipar=10;
- elseif (ot==6) then model.ipar=1;
- elseif (ot==7) then model.ipar=11;
- elseif (ot==8) then model.ipar=12;
+ if (ot==1) then
+ model.ipar=8;
+ elseif (ot==4) then
+ model.ipar=9;
+ elseif (ot==5) then
+ model.ipar=10;
+ elseif (ot==6) then
+ model.ipar=1;
+ elseif (ot==7) then
+ model.ipar=11;
+ elseif (ot==8) then
+ model.ipar=12;
end
elseif (it==4) then
- if (ot==1) then model.ipar=13;
- elseif (ot==3) then model.ipar=14;
- elseif (ot==5) then model.ipar=15;
- elseif (ot==6) then model.ipar=16;
- elseif (ot==7) then model.ipar=1;
- elseif (ot==8) then model.ipar=17;
+ if (ot==1) then
+ model.ipar=13;
+ elseif (ot==3) then
+ model.ipar=14;
+ elseif (ot==5) then
+ model.ipar=15;
+ elseif (ot==6) then
+ model.ipar=16;
+ elseif (ot==7) then
+ model.ipar=1;
+ elseif (ot==8) then
+ model.ipar=17;
end
elseif (it==5) then
- if (ot==1) then model.ipar=18;
- elseif (ot==3) then model.ipar=19;
- elseif (ot==4) then model.ipar=20;
- elseif (ot==6) then model.ipar=21;
- elseif (ot==7) then model.ipar=22;
- elseif (ot==8) then model.ipar=1;
+ if (ot==1) then
+ model.ipar=18;
+ elseif (ot==3) then
+ model.ipar=19;
+ elseif (ot==4) then
+ model.ipar=20;
+ elseif (ot==6) then
+ model.ipar=21;
+ elseif (ot==7) then
+ model.ipar=22;
+ elseif (ot==8) then
+ model.ipar=1;
end
elseif (it==6) then
- if (ot==1) then model.ipar=23;
- elseif (ot==3) then model.ipar=1;
- elseif (ot==4) then model.ipar=24;
- elseif (ot==5) then model.ipar=25;
- elseif (ot==7) then model.ipar=26;
- elseif (ot==8) then model.ipar=27;
+ if (ot==1) then
+ model.ipar=23;
+ elseif (ot==3) then
+ model.ipar=1;
+ elseif (ot==4) then
+ model.ipar=24;
+ elseif (ot==5) then
+ model.ipar=25;
+ elseif (ot==7) then
+ model.ipar=26;
+ elseif (ot==8) then
+ model.ipar=27;
end
elseif (it==7) then
- if (ot==1) then model.ipar=28;
- elseif (ot==3) then model.ipar=29;
- elseif (ot==4) then model.ipar=1;
- elseif (ot==5) then model.ipar=30;
- elseif (ot==6) then model.ipar=31;
- elseif (ot==8) then model.ipar=32;
+ if (ot==1) then
+ model.ipar=28;
+ elseif (ot==3) then
+ model.ipar=29;
+ elseif (ot==4) then
+ model.ipar=1;
+ elseif (ot==5) then
+ model.ipar=30;
+ elseif (ot==6) then
+ model.ipar=31;
+ elseif (ot==8) then
+ model.ipar=32;
end
elseif (it==8) then
- if (ot==1) then model.ipar=33;
- elseif (ot==3) then model.ipar=34;
- elseif (ot==4) then model.ipar=35;
- elseif (ot==5) then model.ipar=1;
- elseif (ot==6) then model.ipar=36;
- elseif (ot==7) then model.ipar=37;
+ if (ot==1) then
+ model.ipar=33;
+ elseif (ot==3) then
+ model.ipar=34;
+ elseif (ot==4) then
+ model.ipar=35;
+ elseif (ot==5) then
+ model.ipar=1;
+ elseif (ot==6) then
+ model.ipar=36;
+ elseif (ot==7) then
+ model.ipar=37;
end
end
elseif (np==1) then
if (it==1) then
- if (ot==3) then model.ipar=38;
- elseif (ot==4) then model.ipar=39;
- elseif (ot==5) then model.ipar=40;
- elseif (ot==6) then model.ipar=41;
- elseif (ot==7) then model.ipar=42;
- elseif (ot==8) then model.ipar=43;
+ if (ot==3) then
+ model.ipar=38;
+ elseif (ot==4) then
+ model.ipar=39;
+ elseif (ot==5) then
+ model.ipar=40;
+ elseif (ot==6) then
+ model.ipar=41;
+ elseif (ot==7) then
+ model.ipar=42;
+ elseif (ot==8) then
+ model.ipar=43;
end
elseif (it==3) then
- if (ot==1) then model.ipar=8;
- elseif (ot==4) then model.ipar=44;
- elseif (ot==5) then model.ipar=45;
- elseif (ot==6) then model.ipar=46;
- elseif (ot==7) then model.ipar=47;
- elseif (ot==8) then model.ipar=48;
+ if (ot==1) then
+ model.ipar=8;
+ elseif (ot==4) then
+ model.ipar=44;
+ elseif (ot==5) then
+ model.ipar=45;
+ elseif (ot==6) then
+ model.ipar=46;
+ elseif (ot==7) then
+ model.ipar=47;
+ elseif (ot==8) then
+ model.ipar=48;
end
elseif (it==4) then
- if (ot==1) then model.ipar=13;
- elseif (ot==3) then model.ipar=14;
- elseif (ot==5) then model.ipar=49;
- elseif (ot==6) then model.ipar=50;
- elseif (ot==7) then model.ipar=51;
- elseif (ot==8) then model.ipar=52;
+ if (ot==1) then
+ model.ipar=13;
+ elseif (ot==3) then
+ model.ipar=14;
+ elseif (ot==5) then
+ model.ipar=49;
+ elseif (ot==6) then
+ model.ipar=50;
+ elseif (ot==7) then
+ model.ipar=51;
+ elseif (ot==8) then
+ model.ipar=52;
end
elseif (it==5) then
- if (ot==1) then model.ipar=18;
- elseif (ot==3) then model.ipar=19;
- elseif (ot==4) then model.ipar=20;
- elseif (ot==6) then model.ipar=53;
- elseif (ot==7) then model.ipar=54;
- elseif (ot==8) then model.ipar=55;
+ if (ot==1) then
+ model.ipar=18;
+ elseif (ot==3) then
+ model.ipar=19;
+ elseif (ot==4) then
+ model.ipar=20;
+ elseif (ot==6) then
+ model.ipar=53;
+ elseif (ot==7) then
+ model.ipar=54;
+ elseif (ot==8) then
+ model.ipar=55;
end
elseif (it==6) then
- if (ot==1) then model.ipar=23;
- elseif (ot==3) then model.ipar=56;
- elseif (ot==4) then model.ipar=57;
- elseif (ot==5) then model.ipar=58;
- elseif (ot==7) then model.ipar=59;
- elseif (ot==8) then model.ipar=60;
+ if (ot==1) then
+ model.ipar=23;
+ elseif (ot==3) then
+ model.ipar=56;
+ elseif (ot==4) then
+ model.ipar=57;
+ elseif (ot==5) then
+ model.ipar=58;
+ elseif (ot==7) then
+ model.ipar=59;
+ elseif (ot==8) then
+ model.ipar=60;
end
elseif (it==7) then
- if (ot==1) then model.ipar=28;
- elseif (ot==3) then model.ipar=29;
- elseif (ot==4) then model.ipar=61;
- elseif (ot==5) then model.ipar=62;
- elseif (ot==6) then model.ipar=31;
- elseif (ot==8) then model.ipar=63;
+ if (ot==1) then
+ model.ipar=28;
+ elseif (ot==3) then
+ model.ipar=29;
+ elseif (ot==4) then
+ model.ipar=61;
+ elseif (ot==5) then
+ model.ipar=62;
+ elseif (ot==6) then
+ model.ipar=31;
+ elseif (ot==8) then
+ model.ipar=63;
end
elseif (it==8) then
- if (ot==1) then model.ipar=33;
- elseif (ot==3) then model.ipar=34;
- elseif (ot==4) then model.ipar=35;
- elseif (ot==5) then model.ipar=64;
- elseif (ot==6) then model.ipar=36;
- elseif (ot==7) then model.ipar=37;
+ if (ot==1) then
+ model.ipar=33;
+ elseif (ot==3) then
+ model.ipar=34;
+ elseif (ot==4) then
+ model.ipar=35;
+ elseif (ot==5) then
+ model.ipar=64;
+ elseif (ot==6) then
+ model.ipar=36;
+ elseif (ot==7) then
+ model.ipar=37;
end
end
elseif (np==2) then
if (it==1) then
- if (ot==3) then model.ipar=65;
- elseif (ot==4) then model.ipar=66;
- elseif (ot==5) then model.ipar=67;
- elseif (ot==6) then model.ipar=68;
- elseif (ot==7) then model.ipar=69;
- elseif (ot==8) then model.ipar=70;
+ if (ot==3) then
+ model.ipar=65;
+ elseif (ot==4) then
+ model.ipar=66;
+ elseif (ot==5) then
+ model.ipar=67;
+ elseif (ot==6) then
+ model.ipar=68;
+ elseif (ot==7) then
+ model.ipar=69;
+ elseif (ot==8) then
+ model.ipar=70;
end
elseif (it==3) then
- if (ot==1) then model.ipar=8;
- elseif (ot==4) then model.ipar=71;
- elseif (ot==5) then model.ipar=72;
- elseif (ot==6) then model.ipar=73;
- elseif (ot==7) then model.ipar=74;
- elseif (ot==8) then model.ipar=75;
+ if (ot==1) then
+ model.ipar=8;
+ elseif (ot==4) then
+ model.ipar=71;
+ elseif (ot==5) then
+ model.ipar=72;
+ elseif (ot==6) then
+ model.ipar=73;
+ elseif (ot==7) then
+ model.ipar=74;
+ elseif (ot==8) then
+ model.ipar=75;
end
elseif (it==4) then
- if (ot==1) then model.ipar=13;
- elseif (ot==3) then model.ipar=14;
- elseif (ot==5) then model.ipar=76;
- elseif (ot==6) then model.ipar=77;
- elseif (ot==7) then model.ipar=78;
- elseif (ot==8) then model.ipar=79;
+ if (ot==1) then
+ model.ipar=13;
+ elseif (ot==3) then
+ model.ipar=14;
+ elseif (ot==5) then
+ model.ipar=76;
+ elseif (ot==6) then
+ model.ipar=77;
+ elseif (ot==7) then
+ model.ipar=78;
+ elseif (ot==8) then
+ model.ipar=79;
end
elseif (it==5) then
- if (ot==1) then model.ipar=18;
- elseif (ot==3) then model.ipar=19;
- elseif (ot==4) then model.ipar=20;
- elseif (ot==6) then model.ipar=80;
- elseif (ot==7) then model.ipar=81;
- elseif (ot==8) then model.ipar=82;
+ if (ot==1) then
+ model.ipar=18;
+ elseif (ot==3) then
+ model.ipar=19;
+ elseif (ot==4) then
+ model.ipar=20;
+ elseif (ot==6) then
+ model.ipar=80;
+ elseif (ot==7) then
+ model.ipar=81;
+ elseif (ot==8) then
+ model.ipar=82;
end
elseif (it==6) then
- if (ot==1) then model.ipar=23;
- elseif (ot==3) then model.ipar=83;
- elseif (ot==4) then model.ipar=84;
- elseif (ot==5) then model.ipar=85;
- elseif (ot==7) then model.ipar=86;
- elseif (ot==8) then model.ipar=87;
+ if (ot==1) then
+ model.ipar=23;
+ elseif (ot==3) then
+ model.ipar=83;
+ elseif (ot==4) then
+ model.ipar=84;
+ elseif (ot==5) then
+ model.ipar=85;
+ elseif (ot==7) then
+ model.ipar=86;
+ elseif (ot==8) then
+ model.ipar=87;
end
elseif (it==7) then
- if (ot==1) then model.ipar=28;
- elseif (ot==3) then model.ipar=29;
- elseif (ot==4) then model.ipar=88;
- elseif (ot==5) then model.ipar=89;
- elseif (ot==6) then model.ipar=31;
- elseif (ot==8) then model.ipar=90;
+ if (ot==1) then
+ model.ipar=28;
+ elseif (ot==3) then
+ model.ipar=29;
+ elseif (ot==4) then
+ model.ipar=88;
+ elseif (ot==5) then
+ model.ipar=89;
+ elseif (ot==6) then
+ model.ipar=31;
+ elseif (ot==8) then
+ model.ipar=90;
end
elseif (it==8) then
- if (ot==1) then model.ipar=33;
- elseif (ot==3) then model.ipar=34;
- elseif (ot==4) then model.ipar=35;
- elseif (ot==5) then model.ipar=91;
- elseif (ot==6) then model.ipar=36;
- elseif (ot==7) then model.ipar=37;
+ if (ot==1) then
+ model.ipar=33;
+ elseif (ot==3) then
+ model.ipar=34;
+ elseif (ot==4) then
+ model.ipar=35;
+ elseif (ot==5) then
+ model.ipar=91;
+ elseif (ot==6) then
+ model.ipar=36;
+ elseif (ot==7) then
+ model.ipar=37;
end
end
end
end
if ok then
graphics.exprs=exprs
- x.graphics=graphics;x.model=model
+ x.graphics=graphics;
+ x.model=model
break
end
end
exprs=[sci2exp(1);sci2exp(3);sci2exp(0)]
- gr_i=["xstringb(orig(1),orig(2),[''convert to'';OPER],sz(1),sz(2),''fill'');"]
+ gr_i=[]
x=standard_define([3 2],model, exprs,gr_i)
end
endfunction
function [x,y,typ]=DFLIPFLOP(job,arg1,arg2)
// Copyright INRIA
- x=[];y=[],typ=[]
+ x=[];
+ y=[];
+ typ=[];
select job
- case "plot" then
- standard_draw(arg1)
- case "getinputs" then
- [x,y,typ]=standard_inputs(arg1)
- case "getoutputs" then
- [x,y,typ]=standard_outputs(arg1)
- case "getorigin" then
- [x,y]=standard_origin(arg1)
case "set" then
x=arg1
case "define" then
pout=6,..
pein=[],..
peout=[],..
- gr_i=list(..
- ["dx=sz(1)/5;dy=sz(2)/10;";
- "w=sz(1)-2*dx;h=sz(2)-2*dy;";
- "txt=C;";
- "xstringb(orig(1)+dx,orig(2)+dy,txt,w,h,''fill'');"],8),..
+ gr_i=[],..
id="",..
in_implicit=[],..
out_implicit="E"),..
pout=[],..
pein=22,..
peout=[16;44],..
- gr_i=list(..
- ["txt=[''If in>0'';'' '';'' then else''];";
- "xstringb(orig(1),orig(2),txt,sz(1),sz(2),''fill'');"],8),..
+ gr_i=[],..
id="",..
in_implicit="E",..
out_implicit=[]),..
pout=5,..
pein=[],..
peout=[],..
- gr_i=list(..
- "xstringb(orig(1),orig(2),['' Logical Op '';OPER],sz(1),sz(2),''fill'');",8),..
+ gr_i=[],..
id="",..
in_implicit=["E";"E"],..
out_implicit="E"),..
pout=33,..
pein=42,..
peout=[],..
- gr_i=list("xstringb(orig(1),orig(2),''S/H'',sz(1),sz(2),''fill'')",8),..
+ gr_i=[],..
id="",..
in_implicit="E",..
out_implicit="E"),..
pout=13,..
pein=[],..
peout=[],..
- gr_i=list(..
- "xstringb(orig(1),orig(2),[''Logical Op '';OPER],sz(1),sz(2),''fill'');",8),..
+ gr_i=[],..
id="",..
in_implicit="E",..
out_implicit="E"),..
pout=9,..
pein=[],..
peout=[],..
- gr_i=list(" ",8),..
+ gr_i=[],..
id="",..
in_implicit=[],..
out_implicit="E"),..
pout=11,..
pein=[],..
peout=[],..
- gr_i=list(" ",8),..
+ gr_i=[],..
id="",..
in_implicit=[],..
out_implicit="E"),..
pout=[],..
pein=[],..
peout=[],..
- gr_i=list(" ",8),..
+ gr_i=[],..
id="",..
in_implicit="E",..
out_implicit=[]),..
pout=[],..
pein=[],..
peout=[],..
- gr_i=list(" ",8),..
+ gr_i=[],..
id="",..
in_implicit="E",..
out_implicit=[]),..
pout=9,..
pein=[4;11],..
peout=[],..
- gr_i=list(..
- ["txt=[''LOGICAL'';'' '';'' AND ''];";
- "xstringb(orig(1),orig(2),txt,sz(1),sz(2),''fill'');"],8),..
+ gr_i=[],..
id="",..
in_implicit=[],..
out_implicit="E"),..
pout=[],..
pein=[],..
peout=4,..
- gr_i=list(" ",8),..
+ gr_i=[],..
id="",..
in_implicit=[],..
out_implicit=[]),..
pout=[],..
pein=8,..
peout=[],..
- gr_i=list(" ",8),..
+ gr_i=[],..
id="",..
in_implicit=[],..
out_implicit=[]),..
pout=[],..
pein=[],..
peout=6,..
- gr_i=list(" ",8),..
+ gr_i=[],..
id="",..
in_implicit=[],..
out_implicit=[]),..
pout=[],..
pein=12,..
peout=[8;0],..
- gr_i=list(..
- ["txt=[''If in>0'';'' '';'' then else''];";
- "xstringb(orig(1),orig(2),txt,sz(1),sz(2),''fill'');"],8),..
+ gr_i=[],..
id="",..
in_implicit="E",..
out_implicit=[]),..
pout=[],..
pein=6,..
peout=[11;12],..
- gr_i=list([],8),..
+ gr_i=[],..
id="",..
in_implicit=[],..
out_implicit=[]),..
pout=[],..
pein=[19;16],..
peout=17,..
- gr_i=list("xstringb(orig(1),orig(2),''ANDBLK'',sz(1),sz(2),''fill'')",8),..
+ gr_i=[],..
id="",..
in_implicit=[],..
out_implicit=[]),..
pout=3,..
pein=[],..
peout=[],..
- gr_i=list("xstringb(orig(1),orig(2),[''Edge'';''trigger''],sz(1),sz(2),''fill'');",8),..
+ gr_i=[],..
id="",..
in_implicit="E",..
out_implicit="E"),..
pout=[],..
pein=[],..
peout=[7;0],..
- gr_i=list(..
- ["txt=[''If in>0'';'' '';'' then else''];";
- "xstringb(orig(1),orig(2),txt,sz(1),sz(2),''fill'');"],8),..
+ gr_i=[],..
id="",..
in_implicit="E",..
out_implicit=[]),..
pout=5,..
pein=[],..
peout=[],..
- gr_i=list(" ",8),..
+ gr_i=[],..
id="",..
in_implicit=[],..
out_implicit="E"),..
pout=[],..
pein=7,..
peout=[],..
- gr_i=list(" ",8),..
+ gr_i=[],..
id="",..
in_implicit=[],..
out_implicit=[]),..
pout=[],..
pein=[],..
peout=19,..
- gr_i=list("xstringb(orig(1),orig(2),[''EDGE'';''TRIGGER''],sz(1),sz(2),''fill'')",8),..
+ gr_i=[],..
id="",..
in_implicit="E",..
out_implicit=[]),..
pout=23,..
pein=[],..
peout=[],..
- gr_i=list(" ",8),..
+ gr_i=[],..
id="",..
in_implicit=[],..
out_implicit="E"),..
pout=[],..
pein=[],..
peout=[3;4],..
- gr_i=list(..
- ["txt=[''If in>0'';'' '';'' then else''];";
- "xstringb(orig(1),orig(2),txt,sz(1),sz(2),''fill'');"],8),..
+ gr_i=[],..
id="",..
in_implicit="E",..
out_implicit=[]),..
pout=[],..
pein=[3;4;0],..
peout=8,..
- gr_i=list(..
- ["rx=sz(1)*p/2;ry=sz(2)/2";
- "xsegs(orig(1)+rx*[1/2.3 1;2-1/2.3 1],orig(2)+ry*[1 2-1/2.3;1,1/2.3],0)"],8),..
+ gr_i=[],..
id="",..
in_implicit=[],..
out_implicit=[]),..
pout=6,..
pein=[],..
peout=[],..
- gr_i=list(" ",8),..
+ gr_i=[],..
id="",..
in_implicit=[],..
out_implicit="E"),..
pout=[],..
pein=8,..
peout=[],..
- gr_i=list(" ",8),..
+ gr_i=[],..
id="",..
in_implicit=[],..
out_implicit=[]),..
pout=[],..
pein=[],..
peout=22,..
- gr_i=list(..
- "xstringb(orig(1),orig(2),[''Extract'';''Activation''],sz(1),sz(2),''fill'')",8),..
+ gr_i=[],..
id="",..
in_implicit="E",..
out_implicit=[]),..
pout=31,..
pein=[],..
peout=[],..
- gr_i=list(..
- ["rx=sz(1)*p/2;ry=sz(2)/2";
- "xsegs(orig(1)+rx*[1/2.3 1;2-1/2.3 1],orig(2)+ry*[1 2-1/2.3;1,1/2 .3],0)"],8),..
+ gr_i=[],..
id="",..
in_implicit=["E";"E";"E"],..
out_implicit="E"),..
pout=[26;27],..
pein=[],..
peout=[],..
- gr_i=list([],8),..
+ gr_i=[],..
id="",..
in_implicit="E",..
out_implicit=["E";"E";"E"]),..
pout=[29;30],..
pein=[],..
peout=[],..
- gr_i=list([],8),..
+ gr_i=[],..
id="",..
in_implicit="E",..
out_implicit=["E";"E";"E"]),..
pout=34,..
pein=[43;44],..
peout=[],..
- gr_i=list("xstringb(orig(1),orig(2),''Selector'',sz(1),sz(2),''fill'');",8),..
+ gr_i=[],..
id="",..
in_implicit=["E";"E"],..
out_implicit="E"),..
pout=[36;37],..
pein=[],..
peout=[],..
- gr_i=list([],8),..
+ gr_i=[],..
id="",..
in_implicit="E",..
out_implicit=["E";"E";"E"]),..
pout=[39;40],..
pein=[],..
peout=[],..
- gr_i=list([],8),..
+ gr_i=[],..
id="",..
in_implicit="E",..
out_implicit=["E";"E";"E"]),..
pout=[],..
pein=17,..
peout=[42;43],..
- gr_i=list([],8),..
+ gr_i=[],..
id="",..
in_implicit=[],..
out_implicit=[]),..
model.firing=%f
model.dep_ut=[%t %f]
model.rpar=scs_m
- gr_i=["[x,y,typ]=standard_inputs(o) ";
- "dd=sz(1)/8,de=5.5*sz(1)/8";
- "if ~exists(''%zoom'') then %zoom=1, end;"
- "txt=''D'';"
- "rectstr=stringbox(txt,orig(1)+dd,y(1)-4,0,1,1);"
- "w=(rectstr(1,3)-rectstr(1,2))*%zoom;"
- "h=(rectstr(2,2)-rectstr(2,4))*%zoom;"
- "xstringb(orig(1)+dd,y(1)-4,txt,w,h,''fill'')";
- "txt=''clk'';"
- "rectstr=stringbox(txt,orig(1)+dd,y(2)-4,0,1,1);"
- "w=(rectstr(1,3)-rectstr(1,2))*%zoom;"
- "h=(rectstr(2,2)-rectstr(2,4))*%zoom;"
- "xstringb(orig(1)+dd,y(2)-4,txt,w,h,''fill'')";
- "txt=''en'';"
- "rectstr=stringbox(txt,orig(1)+dd,y(3)-4,0,1,1);"
- "w=(rectstr(1,3)-rectstr(1,2))*%zoom;"
- "h=(rectstr(2,2)-rectstr(2,4))*%zoom;"
- "xstringb(orig(1)+dd,y(3)-4,txt,w,h,''fill'')";
- "[x,y,typ]=standard_outputs(o) ";
- "txt=''Q'';"
- "rectstr=stringbox(txt,orig(1)+de,y(1)-4,0,1,1);"
- "w=(rectstr(1,3)-rectstr(1,2))*%zoom;"
- "h=(rectstr(2,2)-rectstr(2,4))*%zoom;"
- "xstringb(orig(1)+de,y(1)-4,txt,w,h,''fill'')";
- "txt=''!Q'';"
- "rectstr=stringbox(txt,orig(1)+4.5*dd,y(2)-4,0,1,1);"
- "w=(rectstr(1,3)-rectstr(1,2))*%zoom;"
- "h=(rectstr(2,2)-rectstr(2,4))*%zoom;"
- "xstringb(orig(1)+4.5*dd,y(2)-4,txt,w,h,''fill'')";
- "txt=''D FLIP-FLOP'';"
- "style=5;"
- "rectstr=stringbox(txt,orig(1),orig(2),0,style,1);"
- "w=(rectstr(1,3)-rectstr(1,2))*%zoom;"
- "h=(rectstr(2,2)-rectstr(2,4))*%zoom;"
- "xstringb(orig(1)+sz(1)/2-w/2,orig(2)-h-4,txt,w,h,''fill'');"
- "e=gce();"
- "e.font_style=style;"]
+ gr_i=[]
x=standard_define([2 3],model,[],gr_i)
end
endfunction
function [x,y,typ]=DLATCH(job,arg1,arg2)
x=[];y=[],typ=[]
select job
- case "plot" then
- standard_draw(arg1)
- case "getinputs" then
- [x,y,typ]=standard_inputs(arg1)
- case "getoutputs" then
- [x,y,typ]=standard_outputs(arg1)
- case "getorigin" then
- [x,y]=standard_origin(arg1)
case "set" then
x=arg1
case "define" then
pout=7,..
pein=[],..
peout=[],..
- gr_i=list(..
- ["dx=sz(1)/5;dy=sz(2)/10;";
- "w=sz(1)-2*dx;h=sz(2)-2*dy;";
- "txt=C;";
- "xstringb(orig(1)+dx,orig(2)+dy,txt,w,h,''fill'');"],8),..
+ gr_i=[],..
id="",..
in_implicit=[],..
out_implicit="E"),..
model.firing=%f
model.dep_ut=[%t %f]
model.rpar=scs_m
- gr_i=["[x,y,typ]=standard_inputs(o) ";
- "dd=sz(1)/8,de=5.5*sz(1)/8";
- "txt=''D'';"
- "if ~exists(''%zoom'') then %zoom=1, end;"
- "rectstr=stringbox(txt,orig(1)+dd,y(1)-4,0,1,1);"
- "w=(rectstr(1,3)-rectstr(1,2))*%zoom;"
- "h=(rectstr(2,2)-rectstr(2,4))*%zoom;"
- "xstringb(orig(1)+dd,y(1)-4,txt,w,h,''fill'')";
- "txt=''C'';"
- "rectstr=stringbox(txt,orig(1)+dd,y(2)-4,0,1,1);"
- "w=(rectstr(1,3)-rectstr(1,2))*%zoom;"
- "h=(rectstr(2,2)-rectstr(2,4))*%zoom;"
- "xstringb(orig(1)+dd,y(2)-4,txt,w,h,''fill'')";
- "txt=''Q'';"
- "rectstr=stringbox(txt,orig(1)+de,y(1)-4,0,1,1);"
- "w=(rectstr(1,3)-rectstr(1,2))*%zoom;"
- "h=(rectstr(2,2)-rectstr(2,4))*%zoom;"
- "xstringb(orig(1)+de,y(1)-4,txt,w,h,''fill'')";
- "txt=''!Q'';"
- "rectstr=stringbox(txt,orig(1)+4.5*dd,y(2)-4,0,1,1);"
- "w=(rectstr(1,3)-rectstr(1,2))*%zoom;"
- "h=(rectstr(2,2)-rectstr(2,4))*%zoom;"
- "xstringb(orig(1)+4.5*dd,y(2)-4,txt,w,h,''fill'')";
- "txt=''DLATCH'';"
- "style=5;"
- "rectstr=stringbox(txt,orig(1),orig(2),0,style,1);"
- "w=(rectstr(1,3)-rectstr(1,2))*%zoom;"
- "h=(rectstr(2,2)-rectstr(2,4))*%zoom;"
- "xstringb(orig(1)+sz(1)/2-w/2,orig(2)-h-4,txt,w,h,''fill'');"
- "e=gce();"
- "e.font_style=style;"]
+ gr_i=[]
x=standard_define([2 3],model,[],gr_i)
end
endfunction
//
function [x,y,typ]=EXTRACTBITS(job,arg1,arg2)
- x=[];y=[];typ=[]
+ x=[];
+ y=[];
+ typ=[];
select job
- case "plot" then
- if (size(arg1.model.ipar,"*")~=4) then numb=[];
- else numb=arg1.model.ipar(3)
- end
- VOP=["Upper Half","Lower Half","Upper End","Lower End"," "+string(arg1.graphics.exprs(3))+" "]
- OPER=VOP(evstr( arg1.graphics.exprs(2)))
- standard_draw(arg1)
- case "getinputs" then
- [x,y,typ]=standard_inputs(arg1)
- case "getoutputs" then
- [x,y,typ]=standard_outputs(arg1)
- case "getorigin" then
- [x,y]=standard_origin(arg1)
case "set" then
x=arg1;
graphics=arg1.graphics;exprs=graphics.exprs
gettext("Number of Bits or Index of Bit"); gettext("Treat Bit Field as an Integer (0:No, 1:Yes)")],..
list("vec",1,"vec",1,"vec",-1,"vec",1), exprs);
- if ~ok then break,end
+ if ~ok then
+ break,
+ end
bitstr = strcat(string(bit(:))," ")
if (rule < 1) | (rule > 5) then
block_parameter_error(msprintf(gettext("Wrong value for ''%s'' parameter: %d."), gettext("Bits to Extract"), rule), ..
ok = %f
else
- in=[model.in model.in2];bit=int(bit);rule=int(rule);
+ in=[model.in model.in2];
+ bit=int(bit);
+ rule=int(rule);
if (rule==3)|(rule==4) then
if (size(bit,"*") ~= 1) then
block_parameter_error(msprintf(gettext("Wrong size for ''%s'' parameter: %s."), gettext("Number of Bits or Index of Bit"), bitstr), ..
gettext("Must be a single value."));
ok=%f;
- else numb=bit;
+ else
+ numb=bit;
end
elseif (rule==5)
if (size(bit,"*") ~= 2) then
block_parameter_error(msprintf(gettext("Wrong values for ''%s'' parameter: %s."), gettext("Number of Bits or Index of Bit"), bitstr), ..
msprintf(gettext("''Start'' must be less than ''End''.")));
ok=%f;
- else numb=bit(2)-bit(1);
+ else
+ numb=bit(2)-bit(1);
end ;
- else bit=0;numb=[]
+ else
+ bit=0;
+ numb=[]
end
end
select rule
case 1 then
select scal
- case 0 then model.sim=list("extract_bit_32_UH0",4)
+ case 0 then
+ model.sim=list("extract_bit_32_UH0",4)
case 1 then
select Datatype
- case 3 then model.sim=list("extract_bit_32_UH1",4)
- case 6 then model.sim=list("extract_bit_u32_UH1",4)
+ case 3 then
+ model.sim=list("extract_bit_32_UH1",4)
+ case 6 then
+ model.sim=list("extract_bit_u32_UH1",4)
end
end
case 2 then
model.sim=list("extract_bit_32_LH",4)
case 3 then
select scal
- case 0 then model.sim=list("extract_bit_32_MSB0",4)
+ case 0 then
+ model.sim=list("extract_bit_32_MSB0",4)
case 1 then
select Datatype
- case 3 then model.sim=list("extract_bit_32_MSB1",4)
- case 6 then model.sim=list("extract_bit_u32_MSB1",4)
+ case 3 then
+ model.sim=list("extract_bit_32_MSB1",4)
+ case 6 then
+ model.sim=list("extract_bit_u32_MSB1",4)
end
end
case 4 then
model.sim=list("extract_bit_32_LSB",4)
case 5 then
select scal
- case 0 then model.sim=list("extract_bit_32_RB0",4)
+ case 0 then
+ model.sim=list("extract_bit_32_RB0",4)
case 1 then
select Datatype
- case 3 then model.sim=list("extract_bit_32_RB1",4)
- case 6 then model.sim=list("extract_bit_u32_RB1",4)
+ case 3 then
+ model.sim=list("extract_bit_32_RB1",4)
+ case 6 then
+ model.sim=list("extract_bit_u32_RB1",4)
end
end
end
select rule
case 1 then
select scal
- case 0 then model.sim=list("extract_bit_16_UH0",4)
+ case 0 then
+ model.sim=list("extract_bit_16_UH0",4)
case 1 then
select Datatype
- case 4 then model.sim=list("extract_bit_16_UH1",4)
- case 7 then model.sim=list("extract_bit_u16_UH1",4)
+ case 4 then
+ model.sim=list("extract_bit_16_UH1",4)
+ case 7 then
+ model.sim=list("extract_bit_u16_UH1",4)
end
end
case 2 then
model.sim=list("extract_bit_16_LH",4)
case 3 then
select scal
- case 0 then model.sim=list("extract_bit_16_MSB0",4)
+ case 0 then
+ model.sim=list("extract_bit_16_MSB0",4)
case 1 then
select Datatype
- case 4 then model.sim=list("extract_bit_16_MSB1",4)
- case 7 then model.sim=list("extract_bit_u16_MSB1",4)
+ case 4 then
+ model.sim=list("extract_bit_16_MSB1",4)
+ case 7 then
+ model.sim=list("extract_bit_u16_MSB1",4)
end
end
case 4 then
model.sim=list("extract_bit_16_LSB",4)
case 5 then
select scal
- case 0 then model.sim=list("extract_bit_16_RB0",4)
+ case 0 then
+ model.sim=list("extract_bit_16_RB0",4)
case 1 then
select Datatype
- case 4 then model.sim=list("extract_bit_16_RB1",4)
- case 7 then model.sim=list("extract_bit_u16_RB1",4)
+ case 4 then
+ model.sim=list("extract_bit_16_RB1",4)
+ case 7 then
+ model.sim=list("extract_bit_u16_RB1",4)
end
end
end
select rule
case 1 then
select scal
- case 0 then model.sim=list("extract_bit_8_UH0",4)
+ case 0 then
+ model.sim=list("extract_bit_8_UH0",4)
case 1 then
select Datatype
- case 5 then model.sim=list("extract_bit_8_UH1",4)
- case 8 then model.sim=list("extract_bit_u8_UH1",4)
+ case 5 then
+ model.sim=list("extract_bit_8_UH1",4)
+ case 8 then
+ model.sim=list("extract_bit_u8_UH1",4)
end
end
case 2 then
model.sim=list("extract_bit_8_LH",4)
case 3 then
select scal
- case 0 then model.sim=list("extract_bit_8_MSB0",4)
+ case 0 then
+ model.sim=list("extract_bit_8_MSB0",4)
case 1 then
select Datatype
- case 5 then model.sim=list("extract_bit_8_MSB1",4)
- case 8 then model.sim=list("extract_bit_u8_MSB1",4)
+ case 5 then
+ model.sim=list("extract_bit_8_MSB1",4)
+ case 8 then
+ model.sim=list("extract_bit_u8_MSB1",4)
end
end
case 4 then
model.sim=list("extract_bit_8_LSB",4)
case 5 then
select scal
- case 0 then model.sim=list("extract_bit_8_RB0",4)
+ case 0 then
+ model.sim=list("extract_bit_8_RB0",4)
case 1 then
select Datatype
- case 5 then model.sim=list("extract_bit_8_RB1",4)
- case 8 then model.sim=list("extract_bit_u8_RB1",4)
+ case 5 then
+ model.sim=list("extract_bit_8_RB1",4)
+ case 8 then
+ model.sim=list("extract_bit_u8_RB1",4)
end
end
end
if ok then
graphics.exprs=exprs;
model.ipar=[int(bit(:));int(numb(:))];
- x.graphics=graphics;x.model=model;
+ x.graphics=graphics;
+ x.model=model;
break
end
end
model.dep_ut=[%t %f]
exprs=[sci2exp(3);sci2exp(1);sci2exp(0);sci2exp(0)]
- gr_i=["xstringb(orig(1),orig(2),['' Extract ''+string(numb)+'' Bits'';OPER],sz(1),sz(2),''fill'');"]
+ gr_i=[]
x=standard_define([4 2],model,exprs,gr_i)
end
//
function [x,y,typ]=INTMUL(job,arg1,arg2)
- x=[];y=[];typ=[];
+ x=[];
+ y=[];
+ typ=[];
select job
- case "plot" then
- sgn=arg1.model.ipar
- standard_draw(arg1)
- case "getinputs" then
- [x,y,typ]=standard_inputs(arg1)
- case "getoutputs" then
- [x,y,typ]=standard_outputs(arg1)
- case "getorigin" then
- [x,y]=standard_origin(arg1)
case "set" then
x=arg1;
graphics=arg1.graphics
[msprintf(gettext("Set %s block parameters"),"INTMUL"); " "; gettext("Integer matrix multiplication");" ";],..
[msprintf(gettext("Data Type %s"), "(3:int32, 4:int16, 5:int8, ...)"); gettext("Do on Overflow (0:Nothing, 1:Saturate, 2:Error)")],..
list("vec",1,"vec",1), exprs)
- if ~ok then break,end
+ if ~ok then
+ break,
+ end
it=Datatype*ones(1,2);
ot=Datatype;
if ok then
model.ipar=np
graphics.exprs=exprs
- x.graphics=graphics;x.model=model
+ x.graphics=graphics;
+ x.model=model
break
end
end
exprs=[sci2exp(3);sci2exp(0)]
- gr_i=["txt=['' INTMUL ''];";
- "xstringb(orig(1),orig(2),txt,sz(1),sz(2),''fill'')"]
+ gr_i=[]
x=standard_define([2 2],model, exprs,gr_i)
end
endfunction
//
function [x,y,typ] = JKFLIPFLOP(job,arg1,arg2)
- x=[];y=[],typ=[]
+ x=[];
+ y=[];
+ typ=[];
select job
- case "plot" then
- standard_draw(arg1)
- case "getinputs" then
- [x,y,typ]=standard_inputs(arg1)
- case "getoutputs" then
- [x,y,typ]=standard_outputs(arg1)
- case "getorigin" then
- [x,y]=standard_origin(arg1)
case "set" then
// look for the 1/z block
for i=1:length(arg1.model.rpar.objs) do
gettext("Initial Value"), ..
list("vec",1), exprs);
- if ~ok then break,end
- if init<=0 then init=int8(0);
- elseif init >0 then init=int8(1);
+ if ~ok then
+ break,
+ end
+ if init<=0 then
+ init=int8(0);
+ elseif init >0 then
+ init=int8(1);
end
if ok then
xx.graphics.exprs(1)=exprs0
pout=5,..
pein=[],..
peout=[],..
- gr_i=list("xstringb(orig(1),orig(2),''1/z'',sz(1),sz(2),''fill'')",8),..
+ gr_i=[],..
id="",..
in_implicit="E",..
out_implicit="E"),..
pout=3,..
pein=[],..
peout=[],..
- gr_i=list("xstringb(orig(1),orig(2),[''Edge'';''trigger''],sz(1),sz(2),''fill'');",8),..
+ gr_i=[],..
id="",..
in_implicit="E",..
out_implicit="E"),..
pout=[],..
pein=[],..
peout=[7;0],..
- gr_i=list(..
- ["txt=[''If in>0'';'' '';'' then else''];";
- "xstringb(orig(1),orig(2),txt,sz(1),sz(2),''fill'');"],8),..
+ gr_i=[],..
id="",..
in_implicit="E",..
out_implicit=[]),..
pout=5,..
pein=[],..
peout=[],..
- gr_i=list(" ",8),..
+ gr_i=[],..
id="",..
in_implicit=[],..
out_implicit="E"),..
pout=[],..
pein=7,..
peout=[],..
- gr_i=list(" ",8),..
+ gr_i=[],..
id="",..
in_implicit=[],..
out_implicit=[]),..
pout=[],..
pein=[],..
peout=8,..
- gr_i=list("xstringb(orig(1),orig(2),[''EDGE'';''TRIGGER''],sz(1),sz(2),''fill'')",8),..
+ gr_i=[],..
id="",..
in_implicit="E",..
out_implicit=[]),..
pout=4,..
pein=8,..
peout=[],..
- gr_i=list("xstringb(orig(1),orig(2),[''Logic''],sz(1),sz(2),''fill'');",8),..
+ gr_i=[],..
id="",..
in_implicit=["E";"E";"E"],..
out_implicit="E"),..
pout=[7;20],..
pein=[],..
peout=[],..
- gr_i=list([],8),..
+ gr_i=[],..
id="",..
in_implicit="E",..
out_implicit=["E";"E";"E"]),..
pout=22,..
pein=[],..
peout=[],..
- gr_i=list(..
- "xstringb(orig(1),orig(2),[''Logical Op '';OPER],sz(1),sz(2),''fill'');",8),..
+ gr_i=[],..
id="",..
in_implicit="E",..
out_implicit="E"),..
pout=[11;12],..
pein=[],..
peout=[],..
- gr_i=list([],8),..
+ gr_i=[],..
id="",..
in_implicit="E",..
out_implicit=["E";"E";"E"]),..
pout=14,..
pein=[],..
peout=[],..
- gr_i=list(" ",8),..
+ gr_i=[],..
id="",..
in_implicit=[],..
out_implicit="E"),..
pout=16,..
pein=[],..
peout=[],..
- gr_i=list(" ",8),..
+ gr_i=[],..
id="",..
in_implicit=[],..
out_implicit="E"),..
pout=18,..
pein=[],..
peout=[],..
- gr_i=list(" ",8),..
+ gr_i=[],..
id="",..
in_implicit=[],..
out_implicit="E"),..
pout=[],..
pein=[],..
peout=[],..
- gr_i=list(" ",8),..
+ gr_i=[],..
id="",..
in_implicit="E",..
out_implicit=[]),..
pout=[],..
pein=[],..
peout=[],..
- gr_i=list(" ",8),..
+ gr_i=[],..
id="",..
in_implicit="E",..
out_implicit=[]),..
model.firing=%f
model.dep_ut=[%t %f]
model.rpar=scs_m
- gr_i=["[x,y,typ]=standard_inputs(o) ";
- "dd=sz(1)/8,de=5.5*sz(1)/8";
- "txt=''J'';"
- "if ~exists(''%zoom'') then %zoom=1, end;"
- "rectstr=stringbox(txt,orig(1)+dd,y(1)-4,0,1,1);"
- "w=(rectstr(1,3)-rectstr(1,2))*%zoom;"
- "h=(rectstr(2,2)-rectstr(2,4))*%zoom;"
- "xstringb(orig(1)+dd,y(1)-4,txt,w,h,''fill'')";
- "txt=''clk'';"
- "rectstr=stringbox(txt,orig(1)+dd,y(2)-4,0,1,1);"
- "w=(rectstr(1,3)-rectstr(1,2))*%zoom;"
- "h=(rectstr(2,2)-rectstr(2,4))*%zoom;"
- "xstringb(orig(1)+dd,y(2)-4,txt,w,h,''fill'')";
- "txt=''K'';"
- "rectstr=stringbox(txt,orig(1)+dd,y(3)-4,0,1,1);"
- "w=(rectstr(1,3)-rectstr(1,2))*%zoom;"
- "h=(rectstr(2,2)-rectstr(2,4))*%zoom;"
- "xstringb(orig(1)+dd,y(3)-4,txt,w,h,''fill'')";
- "[x,y,typ]=standard_outputs(o) ";
- "txt=''Q'';"
- "rectstr=stringbox(txt,orig(1)+de,y(1)-4,0,1,1);"
- "w=(rectstr(1,3)-rectstr(1,2))*%zoom;"
- "h=(rectstr(2,2)-rectstr(2,4))*%zoom;"
- "xstringb(orig(1)+de,y(1)-4,txt,w,h,''fill'')";
- "txt=''!Q'';"
- "rectstr=stringbox(txt,orig(1)+4.5*dd,y(2)-4,0,1,1);"
- "w=(rectstr(1,3)-rectstr(1,2))*%zoom;"
- "h=(rectstr(2,2)-rectstr(2,4))*%zoom;"
- "xstringb(orig(1)+4.5*dd,y(2)-4,txt,w,h,''fill'')";
- "txt=''JK FLIP-FLOP'';"
- "style=5;"
- "rectstr=stringbox(txt,orig(1),orig(2),0,style,1);"
- "w=(rectstr(1,3)-rectstr(1,2))*%zoom;"
- "h=(rectstr(2,2)-rectstr(2,4))*%zoom;"
- "xstringb(orig(1)+sz(1)/2-w/2,orig(2)-h-4,txt,w,h,''fill'');"
- "e=gce();"
- "e.font_style=style;"]
+ gr_i=[]
x=standard_define([2 3],model,[],gr_i)
end
endfunction
//
function [x,y,typ]=LOGIC(job,arg1,arg2)
- x=[];y=[],typ=[]
+ x=[];
+ y=[];
+ typ=[];
select job
- case "plot" then
- standard_draw(arg1)
- case "getinputs" then
- [x,y,typ]=standard_inputs(arg1)
- case "getoutputs" then
- [x,y,typ]=standard_outputs(arg1)
- case "getorigin" then
- [x,y]=standard_origin(arg1)
case "set" then
x=arg1
- graphics=arg1.graphics;exprs=graphics.exprs
+ graphics=arg1.graphics;
+ exprs=graphics.exprs
model=arg1.model;
while %t do
[ok,mat,herit,exprs]=scicos_getvalue([msprintf(gettext("Set %s block parameters"), "LOGIC"); " ";gettext("Combinatorial logic");" ";
[gettext("Truth Table (matrix of outputs)"); gettext("Accepts Inherited Events (0:No, 1:Yes)")], ..
list("mat",[-1,-2],"vec",1), exprs);
- if ~ok then break,end
+ if ~ok then
+ break,
+ end
nout=size(mat,2)
nin=(log(size(mat,1))/log(2))
u1=floor(nin)
graphics.exprs=exprs;
mat=int8(mat);
model.opar=list(mat);
- x.graphics=graphics;x.model=model;
+ x.graphics=graphics;
+ x.model=model;
break
end
end
model.firing=%f
model.dep_ut=[%t %f]
exprs=[sci2exp(mat);sci2exp(0)]
- gr_i=["xstringb(orig(1),orig(2),[''Logic''],sz(1),sz(2),''fill'');"]
+ gr_i=[]
x=standard_define([2 2],model,exprs,gr_i)
end
endfunction
//
function [x,y,typ]=SHIFT(job,arg1,arg2)
- x=[];y=[];typ=[];
+ x=[];
+ y=[];
+ typ=[];
select job
- case "plot" then
- sgn=arg1.model.ipar
- VOP=["Arithmetic", "Circular"]
- OPER=VOP(evstr( arg1.graphics.exprs(3))+1)
- standard_draw(arg1)
- case "getinputs" then
- [x,y,typ]=standard_inputs(arg1)
- case "getoutputs" then
- [x,y,typ]=standard_outputs(arg1)
- case "getorigin" then
- [x,y]=standard_origin(arg1)
case "set" then
x=arg1;
graphics=arg1.graphics
gettext("Shift Type (0:Arithmetic, 1:Circular)")], ..
list("vec",1,"vec",1,"vec",1), exprs);
- if ~ok then break,end
+ if ~ok then
+ break,
+ end
if (np ~= 0 & np ~= 1) then
block_parameter_error(msprintf( gettext("Wrong value for ''%s'' parameter: %d."), gettext("Shift Type"), np), ..
msprintf(gettext("Must be in the interval %s."), "[0, 1]"));
if (Datatype==3 | Datatype==6) then
if nb>0 then
select np
- case 0 then model.sim=list("shift_32_LA",4)
- case 1 then model.sim=list("shift_32_LC",4)
+ case 0 then
+ model.sim=list("shift_32_LA",4)
+ case 1 then
+ model.sim=list("shift_32_LC",4)
end
elseif nb<0
select np
case 0 then
select Datatype
- case 3 model.sim=list("shift_32_RA",4)
- case 6 model.sim=list("shift_u32_RA",4)
+ case 3 then
+ model.sim=list("shift_32_RA",4)
+ case 6 then
+ model.sim=list("shift_u32_RA",4)
end
- case 1 then model.sim=list("shift_32_RC",4)
+ case 1 then
+ model.sim=list("shift_32_RC",4)
end
end
elseif (Datatype==4 | Datatype==7) then
if nb>0 then
select np
- case 0 then model.sim=list("shift_16_LA",4)
- case 1 then model.sim=list("shift_16_LC",4)
+ case 0 then
+ model.sim=list("shift_16_LA",4)
+ case 1 then
+ model.sim=list("shift_16_LC",4)
end
elseif nb<0
select np
case 0 then
select Datatype
- case 4 model.sim=list("shift_16_RA",4)
- case 7 model.sim=list("shift_u16_RA",4)
+ case 4 then
+ model.sim=list("shift_16_RA",4)
+ case 7 then
+ model.sim=list("shift_u16_RA",4)
end
- case 1 then model.sim=list("shift_16_RC",4)
+ case 1 then
+ model.sim=list("shift_16_RC",4)
end
end
elseif (Datatype==5 | Datatype==8) then
if nb>0 then
select np
- case 0 then model.sim=list("shift_8_LA",4)
- case 1 then model.sim=list("shift_8_LC",4)
+ case 0 then
+ model.sim=list("shift_8_LA",4)
+ case 1 then
+ model.sim=list("shift_8_LC",4)
end
elseif nb<0
select np
case 0 then
select Datatype
- case 5 model.sim=list("shift_8_RA",4)
- case 8 model.sim=list("shift_u8_RA",4)
+ case 5 then
+ model.sim=list("shift_8_RA",4)
+ case 8 then
+ model.sim=list("shift_u8_RA",4)
end
- case 1 then model.sim=list("shift_8_RC",4)
+ case 1 then
+ model.sim=list("shift_8_RC",4)
end
end
else
if ok then
model.ipar=nb
graphics.exprs=exprs
- x.graphics=graphics;x.model=model
+ x.graphics=graphics;
+ x.model=model
break
end
end
exprs=[sci2exp(3);sci2exp(0);sci2exp(0)]
- gr_i=["xstringb(orig(1),orig(2),[OPER;'' Shift ''],sz(1),sz(2),''fill'')"]
+ gr_i=[]
x=standard_define([3 2],model, exprs,gr_i)
end
endfunction
//
function [x,y,typ] = SRFLIPFLOP(job,arg1,arg2)
- x=[];y=[],typ=[]
+ x=[];
+ y=[];
+ typ=[];
select job
- case "plot" then
- standard_draw(arg1)
- case "getinputs" then
- [x,y,typ]=standard_inputs(arg1)
- case "getoutputs" then
- [x,y,typ]=standard_outputs(arg1)
- case "getorigin" then
- [x,y]=standard_origin(arg1)
case "set" then
// look for the 1/z block
for i=1:length(arg1.model.rpar.objs) do
gettext("Initial Value"), ..
list("vec",1), exprs)
- if ~ok then break,end
- if init<=0 then init=int8(0);
- elseif init >0 then init=int8(1);
+ if ~ok then
+ break,
+ end
+ if init<=0 then
+ init=int8(0);
+ elseif init >0 then
+ init=int8(1);
end
if ok then
xx.graphics.exprs(1)=exprs0
pout=[3;8],..
pein=[],..
peout=[],..
- gr_i=list("xstringb(orig(1),orig(2),[''Logic''],sz(1),sz(2),''fill'');",8),..
+ gr_i=[],..
id="",..
in_implicit=["E";"E";"E"],..
out_implicit=["E";"E"]),..
pout=4,..
pein=[],..
peout=[],..
- gr_i=list("xstringb(orig(1),orig(2),''1/z'',sz(1),sz(2),''fill'')",8),..
+ gr_i=[],..
id="",..
in_implicit="E",..
out_implicit="E"),..
pout=[6;14],..
pein=[],..
peout=[],..
- gr_i=list([],8),..
+ gr_i=[],..
id="",..
in_implicit="E",..
out_implicit=["E";"E";"E"]),..
pout=[],..
pein=[],..
peout=[],..
- gr_i=list(" ",8),..
+ gr_i=[],..
id="",..
in_implicit="E",..
out_implicit=[]),..
pout=10,..
pein=[],..
peout=[],..
- gr_i=list(" ",8),..
+ gr_i=[],..
id="",..
in_implicit=[],..
out_implicit="E"),..
pout=12,..
pein=[],..
peout=[],..
- gr_i=list(" ",8),..
+ gr_i=[],..
id="",..
in_implicit=[],..
out_implicit="E"),..
pout=[],..
pein=[],..
peout=[],..
- gr_i=list(" ",8),..
+ gr_i=[],..
id="",..
in_implicit="E",..
out_implicit=[]),..
model.firing=%f
model.dep_ut=[%t %f]
model.rpar=scs_m
- gr_i=["[x,y,typ]=standard_inputs(o) ";
- "dd=sz(1)/8,de=5.5*sz(1)/8";
- "txt=''S'';"
- "if ~exists(''%zoom'') then %zoom=1, end;"
- "rectstr=stringbox(txt,orig(1)+dd,y(1)-4,0,1,1);"
- "w=(rectstr(1,3)-rectstr(1,2))*%zoom;"
- "h=(rectstr(2,2)-rectstr(2,4))*%zoom;"
- "xstringb(orig(1)+dd,y(1)-4,txt,w,h,''fill'')";
- "txt=''R'';"
- "rectstr=stringbox(txt,orig(1)+dd,y(2)-4,0,1,1);"
- "w=(rectstr(1,3)-rectstr(1,2))*%zoom;"
- "h=(rectstr(2,2)-rectstr(2,4))*%zoom;"
- "xstringb(orig(1)+dd,y(2)-4,txt,w,h,''fill'')";
- "[x,y,typ]=standard_outputs(o) ";
- "txt=''Q'';"
- "rectstr=stringbox(txt,orig(1)+de,y(1)-4,0,1,1);"
- "w=(rectstr(1,3)-rectstr(1,2))*%zoom;"
- "h=(rectstr(2,2)-rectstr(2,4))*%zoom;"
- "xstringb(orig(1)+de,y(1)-4,txt,w,h,''fill'')";
- "txt=''!Q'';"
- "rectstr=stringbox(txt,orig(1)+4.5*dd,y(2)-4,0,1,1);"
- "w=(rectstr(1,3)-rectstr(1,2))*%zoom;"
- "h=(rectstr(2,2)-rectstr(2,4))*%zoom;"
- "xstringb(orig(1)+4.5*dd,y(2)-4,txt,w,h,''fill'')";
- "txt=''SR FLIP-FLOP'';"
- "style=5;"
- "rectstr=stringbox(txt,orig(1),orig(2),0,style,1);"
- "w=(rectstr(1,3)-rectstr(1,2))*%zoom;"
- "h=(rectstr(2,2)-rectstr(2,4))*%zoom;"
- "xstringb(orig(1)+sz(1)/2-w/2,orig(2)-h-4,txt,w,h,''fill'');"
- "e=gce();"
- "e.font_style=style;"]
+ gr_i=[]
x=standard_define([2 3],model,[],gr_i)
end
endfunction