⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 1553analyzer3.pc

📁 xilinx reference design for 1553B BUS analyer using
💻 PC
📖 第 1 页 / 共 3 页
字号:

@cid "1553";
@ver "1.0";
@name "ANALYZER";
@dbname "BusAnlzr";
@licon1 "../icons/1553large1.bmp";
@sicon1 "../icons/small1.bmp";

//The 1553 Data Bus Analyzer application consists of three pages: 1.)Opening page, 
//with a switch to start/stop the gathering of 1553 messages by the CPLD program, 
//2.)Filter page, which allows the user to select which kinds of 1553 messages to 
//view, and 3.)Display page, which displays the data and allows the user to scroll 
//through the data.  The Display page has menu selections which allow the user to go 
//back to either of the other two pages or exit the application.

include "Ccontrols.c"

library "IOLib"

Chandle  ho1, ho2, ho4, h1, h2, h3, h4, h5, 
h6, h7, h8, h9, h10, h11, h12, h13, h14, h15, 
h16, h17, h18, h19, h20, h21, h22, h23, h24, h25, 
h26, h27, h28, h29, h30, h31, h32, h33, h34, h35, h36, h37, h38, h39, h40,h41;
Chandle  hdf1, hdf2, hdf3, hdf4, hdf5, 
hdf6, hdf7, hdf8, hdf9, hdf10, hdf11,
 hdf12, hdf13, hdf14, hdf15, hdf16, 
 hdf17, hdf18, hdf19, hdf20, hdf21, 
 hdf22, hdf23, hdf47, hdf48, hdf49, 
 hdf50, hdf51, hdf52, hdf53, hdf54, 
 hdf55, hdf56, hdf57, hdf58, hdf59, 
 hdf60, hdf61, hdf62, hdf63, hdf64, hdf65, hdf66, hdf67;
int f; int mf;
//There are 36 words per 1553 message (record) in SRAM:1 command,1 status,2 timestamp, 32 data
//The words of each 1553 message shall appear in the order specified by
//MIL-STD-1553, preceded by time stamp words. Early messages appear at lower
//SRAM address locations.

//main buffer
//38 items for display:1 rt #, 1 tr flag, 1 wordcount,1 subaddress,1 status, 1 timestamp,
//                     32 data words
int mb[38];//enough to hold one record
//filter,search and buffer
int w,findcount,i,j,sacount,si,mbi,showall,both;
int v=0x29000000; //begin search index into sram
int rt,tr,sa[32],rtkey,trkey,sakeys[32];

//extract RT#,TR, subaddress and wordcount from the command word using these masks
int rtmask=0xf800;
int trmask=0x0400;
int samask=0x03e0;
int wcmask=0x001f;
int up,down;
int last_record_locn;
int ts;

//Opening page
oinitcontrols(){
ho1=Cmenubar();
ho2=Cmenu(5,100,100);
Caddmenu(ho1,ho2);
ho4=Cswitch(51,58,60,60,1,0);
}
oinitcontents(){
Csettopic(ho2,"1553 Bus Analyzer");
Csetcontent(ho4,"START");
}
oinititems(){
Cadditem(ho2,"Quit");
}
odrawcontrols(){
Cdraw(ho4);
}
//Filter page
finitcontrols(){
h1=Cmenubar();
h2=Cmenu(5,50,30);
Caddmenu(h1,h2);
h3=Cradio(1,16,78,14);
//h4=Cradio(1,32,52,14);
h5=Clabel(57,34,22,0,2,0);
h6=Cdropdown(82,34,23,2);
h7=Cswitch(112,32,46,14,1,0);
h8=Clabel(4,49,60,0,2,0);
h9=Ccheckbox(3,62,20);
h10=Ccheckbox(46,62,20);
h11=Ccheckbox(89,62,20);
h12=Ccheckbox(132,62,20);
h13=Ccheckbox(3,74,20);
h14=Ccheckbox(46,74,20);
h15=Ccheckbox(89,74,20);
h16=Ccheckbox(132,74,20);
h17=Ccheckbox(3,86,20);
h18=Ccheckbox(46,86,20);
h19=Ccheckbox(89,86,20);
h20=Ccheckbox(132,86,20);
h21=Ccheckbox(3,98,20);
h22=Ccheckbox(46,98,20);
h23=Ccheckbox(89,98,20);
h24=Ccheckbox(132,98,20);
h25=Ccheckbox(3,110,20);
h26=Ccheckbox(46,110,20);
h27=Ccheckbox(89,110,20);
h28=Ccheckbox(132,110,20);
h29=Ccheckbox(3,122,20);
h30=Ccheckbox(46,122,20);
h31=Ccheckbox(89,122,20);
h32=Ccheckbox(132,122,20);
h33=Ccheckbox(3,134,20);
h34=Ccheckbox(46,134,20);
h35=Ccheckbox(89,134,20);
h36=Ccheckbox(132,134,20);
h37=Ccheckbox(3,146,20);
h38=Ccheckbox(46,146,20);
h39=Ccheckbox(89,146,20);
h40=Ccheckbox(132,146,20);
//new display button
h41=Cbutton(112,49,46,12,1,4);

}
finitcontents(){
Csettopic(h2,"Filter");
Csetcontent(h5,"RT->");
Csetcontent(h7,"Show All");
Csetcontent(h8,"Subaddresses:");
Csetcontent(h9,"0");
Csetcontent(h10,"1");
Csetcontent(h11,"2");
Csetcontent(h12,"3");
Csetcontent(h13,"4");
Csetcontent(h14,"5");
Csetcontent(h15,"6");
Csetcontent(h16,"7");
Csetcontent(h17,"8");
Csetcontent(h18,"9");
Csetcontent(h19,"10");
Csetcontent(h20,"11");
Csetcontent(h21,"12");
Csetcontent(h22,"13");
Csetcontent(h23,"14");
Csetcontent(h24,"15");
Csetcontent(h25,"16");
Csetcontent(h26,"17");
Csetcontent(h27,"18");
Csetcontent(h28,"19");
Csetcontent(h29,"20");
Csetcontent(h30,"21");
Csetcontent(h31,"22");
Csetcontent(h32,"23");
Csetcontent(h33,"24");
Csetcontent(h34,"25");
Csetcontent(h35,"26");
Csetcontent(h36,"27");
Csetcontent(h37,"28");
Csetcontent(h38,"29");
Csetcontent(h39,"30");
Csetcontent(h40,"31");
Csetcontent(h41,"Display");
}
dfinitcontrols(){
hdf1=Cmenubar();
hdf2=Cmenu(5,60,50);
Caddmenu(hdf1,hdf2);
hdf3=Clabel(2,18,44,0,0,0);
hdf4=Clabel(51,18,30,1,0,1);
hdf5=Clabel(86,18,16,0,0,0);
hdf6=Clabel(104,18,12,1,0,1);
hdf7=Clabel(120,18,10,0,0,0);
hdf8=Clabel(131,18,24,1,0,1);
hdf9=Clabel(4,33,12,0,0,0);
hdf10=Clabel(21,33,67,1,0,1);
hdf11=Clabel(2,48,24,1,0,1);
hdf12=Clabel(35,48,24,1,0,1);
hdf13=Clabel(68,48,24,1,0,1);
hdf14=Clabel(101,48,24,1,0,1);
hdf15=Cbutton(138,48,18,12,1,4);
hdf16=Clabel(2,62,24,1,0,1);
hdf17=Clabel(35,62,24,1,0,1);
hdf18=Clabel(68,62,24,1,0,1);
hdf19=Clabel(101,62,24,1,0,1);
hdf20=Clabel(2,76,24,1,0,1);
hdf21=Clabel(35,76,24,1,0,1);
hdf22=Clabel(68,76,24,1,0,1);
hdf23=Clabel(101,76,24,1,0,1);
hdf47=Clabel(2,90,24,1,0,1);
hdf48=Clabel(35,90,24,1,0,1);
hdf49=Clabel(68,90,24,1,0,1);
hdf50=Clabel(101,90,24,1,0,1);
hdf51=Clabel(2,104,24,1,0,1);
hdf52=Clabel(35,104,24,1,0,1);
hdf53=Clabel(68,104,24,1,0,1);
hdf54=Clabel(101,104,24,1,0,1);
hdf55=Clabel(2,118,24,1,0,1);
hdf56=Clabel(35,118,24,1,0,1);
hdf57=Clabel(68,118,24,1,0,1);
hdf58=Clabel(101,118,24,1,0,1);
hdf59=Clabel(2,132,24,1,0,1);
hdf60=Clabel(35,132,24,1,0,1);
hdf61=Clabel(68,132,24,1,0,1);
hdf62=Clabel(101,132,24,1,0,1);
hdf63=Clabel(2,146,24,1,0,1);
hdf64=Clabel(35,146,24,1,0,1);
hdf65=Clabel(68,146,24,1,0,1);
hdf66=Clabel(101,146,24,1,0,1);
hdf67=Cbutton(138,146,18,12,1,4);
}

dfinitcontents(){
string sd;
int r;
Csettopic(hdf2,"Display");
Csetcontent(hdf3,"Command:");
sd=mb[0];
if(mb[1])sd=sd+"T";
else sd=sd+"R";
sd=sd+mb[2];

Csetcontent(hdf4,sd);

Csetcontent(hdf5,"WC:");
sd=mb[3];
Csetcontent(hdf6,sd);

Csetcontent(hdf7,"S:");
sd=hex(mb[4]);
//sd=hex(ts);     //TEMP DISP BIT 0 OF TIME STAMP WORD 2
sd=strright(sd,4);
Csetcontent(hdf8,sd);

Csetcontent(hdf9,"TS:");
//sd=hex(mb[5]);
sd=mb[5];
//sd=strright(sd,4);

Csetcontent(hdf10,sd);
r=6;
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf11,sd);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf12,sd);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf13,sd);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf14,sd);
Csetcontent(hdf15,"^");//<
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf16,sd);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf17,sd);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf18,sd);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf19,sd);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf20,sd);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf21,sd);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf22,sd);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf23,sd);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf47,sd);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf48,sd);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf49,sd);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf50,sd);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf51,sd);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf52,sd);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf53,sd);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf54,sd);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf55,sd);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf56,sd);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf57,sd);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf58,sd);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf59,sd);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf60,sd);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf61,sd);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf62,sd);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf63,sd);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf64,sd);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf65,sd);
sd=hex(mb[r]);
sd=strright(sd,4);
Csetcontent(hdf66,sd);
Csetcontent(hdf67,"v");//>
}

finititems(){
//Cadditem(h2,"Display");
Cadditem(h3,"R");
Cadditem(h3,"T");
Cadditem(h3,"Both");
//Cadditem(h4,"Full");
//Cadditem(h4,"Brief");
Cadditem(h6,"0");
Cadditem(h6,"1");
Cadditem(h6,"2");
Cadditem(h6,"3");
Cadditem(h6,"4");
Cadditem(h6,"5");
Cadditem(h6,"6");
Cadditem(h6,"7");
Cadditem(h6,"8");
Cadditem(h6,"9");
Cadditem(h6,"10");
Cadditem(h6,"11");
Cadditem(h6,"12");
Cadditem(h6,"13");
Cadditem(h6,"14");
Cadditem(h6,"15");
Cadditem(h6,"16");
Cadditem(h6,"17");
Cadditem(h6,"18");
Cadditem(h6,"19");
Cadditem(h6,"20");
Cadditem(h6,"21");
Cadditem(h6,"22");
Cadditem(h6,"23");
Cadditem(h6,"24");
Cadditem(h6,"25");
Cadditem(h6,"26");
Cadditem(h6,"27");
Cadditem(h6,"28");
Cadditem(h6,"29");
Cadditem(h6,"30");
Cadditem(h6,"31");
}
dfinititems(){
Cadditem(hdf2,"New Data");
Cadditem(hdf2,"Filter");
Cadditem(hdf2,"Quit");
}
fdrawcontrols(){
Cdraw(h3);
Cdraw(h5);
Cdraw(h6);
Cdraw(h7);
Cdraw(h8);
Cdraw(h9);
Cdraw(h10);
Cdraw(h11);
Cdraw(h12);
Cdraw(h13);
Cdraw(h14);
Cdraw(h15);
Cdraw(h16);
Cdraw(h17);
Cdraw(h18);
Cdraw(h19);
Cdraw(h20);
Cdraw(h21);
Cdraw(h22);
Cdraw(h23);
Cdraw(h24);
Cdraw(h25);
Cdraw(h26);
Cdraw(h27);
Cdraw(h28);
Cdraw(h29);
Cdraw(h30);
Cdraw(h31);
Cdraw(h32);
Cdraw(h33);
Cdraw(h34);
Cdraw(h35);
Cdraw(h36);
Cdraw(h37);
Cdraw(h38);
Cdraw(h39);
Cdraw(h40);
Cdraw(h41);
}
dfdrawcontrols(){
Cdraw(hdf3);
Cdraw(hdf4);
Cdraw(hdf5);
Cdraw(hdf6);
Cdraw(hdf7);
Cdraw(hdf8);
Cdraw(hdf9);
Cdraw(hdf10);
Cdraw(hdf11);
Cdraw(hdf12);
Cdraw(hdf13);
Cdraw(hdf14);
Cdraw(hdf15);
Cdraw(hdf16);
Cdraw(hdf17);
Cdraw(hdf18);
Cdraw(hdf19);
Cdraw(hdf20);
Cdraw(hdf21);
Cdraw(hdf22);
Cdraw(hdf23);
Cdraw(hdf47);
Cdraw(hdf48);
Cdraw(hdf49);
Cdraw(hdf50);
Cdraw(hdf51);
Cdraw(hdf52);
Cdraw(hdf53);
Cdraw(hdf54);
Cdraw(hdf55);
Cdraw(hdf56);
Cdraw(hdf57);
Cdraw(hdf58);
Cdraw(hdf59);
Cdraw(hdf60);
Cdraw(hdf61);
Cdraw(hdf62);
Cdraw(hdf63);
Cdraw(hdf64);
Cdraw(hdf65);
Cdraw(hdf66);
Cdraw(hdf67);
}


//Opening page handlers
on_ho1(){
}
on_ho4(){
if(Cgetstate(ho4))
  {   Csetcontent(ho4,"STOP");IOWrite(0x2907FFFE,1);//coolrunner start!
      f=0;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -