otuxrtask.docx
- 文档编号:3322080
- 上传时间:2022-11-21
- 格式:DOCX
- 页数:21
- 大小:19.31KB
otuxrtask.docx
《otuxrtask.docx》由会员分享,可在线阅读,更多相关《otuxrtask.docx(21页珍藏版)》请在冰豆网上搜索。
otuxrtask
taskderot(inputbitdsk2derot_fp_que[$],
inputbit[319:
0]dsk2derot_data_320b_que[$],
outputbitderot2dedis_fp_que[$],
outputbit[319:
0]derot2dedis_data_320b_que[$]);
intframe_num_tmp;
intindex_tmp;
intdata_remain;
bitderot2dedis_fp_tmp_que[$];
bit[319:
0]derot2dedis_data_320b_tmp_que[$];
bit[15:
0]dsk2derot_data_16b_ary[];
bit[15:
0]derot2dedis_data_16b_ary[];
byteunsignedoa1=8'hf6;
byteunsignedoa2=8'h28;
bit[47:
0]fas_tmp={dsk2derot_data_320b_que[0][319:
314],
dsk2derot_data_320b_que[1][319:
314],
dsk2derot_data_320b_que[2][319:
314]};
//====================cleartmpque================================================================
derot2dedis_fp_tmp_que.delete();
derot2dedis_data_320b_tmp_que.delete();
derot2dedis_fp_que.delete();
derot2dedis_data_320b_que.delete();
//====================checkdataque================================================================
if(dsk2derot_data_320b_que.size()!
=20*408)//should20frame
`uvm_info(get_type_name(),$sformatf("dsk2derot_data_320b_quesizeunnormal,should'd8160,real%0d",dsk2derot_data_320b_que.size()),UVM_LOW)
if(fas_tmp[47:
8]!
={oa1,oa1,oa1,oa2,oa2})//startofqueshouldfas
`uvm_info(get_type_name(),$sformatf("dsk2derot_data_320b_quefasunnormal,should'hf6f6f62828,real%0h",fas_tmp[47:
8]),UVM_LOW)
//====================derotdata====================================================================
//------------------frame0----------------------|--frame1----||---------------frame0-------------------|--frame1---
//lane190:
15320:
33516000:
16015|304:
319||0:
15320:
33516000:
16015|0:
15
//lane1816:
31336:
35116016:
16031|0:
15||16:
31336:
35116016:
16031|16:
31
//......|...==>||......|...
//lane1288:
303608:
62316288:
16303|272:
287||288:
303608:
62316288:
16303|288:
303
//lane0304:
319624:
63916304:
16319|288:
303||304:
319624:
63916304:
16319|304:
319
//--------------------------------------------------------------------------------------------------------------------
frame_num_tmp=dsk2derot_data_320b_que.size()/408;//4080*4*8/320=408
data_remain=dsk2derot_data_320b_que.size()%408;
if(data_remain!
=0)
frame_num_tmp++;
dsk2derot_data_16b_ary=new[frame_num_tmp*8160];//4080*4*8/16=8160
derot2dedis_data_16b_ary=new[frame_num_tmp*8160];//4080*4*8/16=8160
dsk2derot_data_16b_ary={>>{dsk2derot_data_320b_que}};
for(inti=0;i for(intj=0;j<408;j++) for(intk=0;k<20;k++) begin index_tmp=(k+i%20)>=20? ((k+i%20)-20): (k+i%20); derot2dedis_data_16b_ary[408*i+20*j+k]=dsk2derot_data_16b_ary[408*i+20*j+index_tmp]; end derot2dedis_data_320b_tmp_que={>>{derot2dedis_data_16b_ary}}; derot2dedis_data_320b_tmp_que=derot2dedis_data_320b_tmp_que[0: (dsk2derot_data_320b_que.size()-1)]; //===================generatefp====================== derot2dedis_fp_tmp_que=dsk2derot_fp_que; for(inti=0;i++;i if(i%408=0) dsk2derot_fp_tmp_que[i]=1; //===================sendoneframe================== while (1) begin if(dsk2derot_fp_tmp_que.size()>407) begin dsk2derot_fp_que=dsk2derot_fp_que[0: 407]; derot2dedis_data_320b_que=derot2dedis_data_320b_tmp_que[0: 407]; derot2dedis_fp_tmp_que=derot2dedis_fp_que_tmp[408: $]; derot2dedis_data_320b_tmp_que=derot2dedis_data_320b_tmp_que[408: $]; end else begin dsk2derot_fp_que=dsk2derot_fp_tmp_que; derot2dedis_data_320b_que=derot2dedis_data_320b_tmp_que; break; end end endtask: derot taskdedis(inputbitderot2dedis_fp_que[$], inputbit[319: 0]derot2dedis_data_320b_que[$] outputbit[255: 0]dedis2fa_data_256b_que[$]); intblock_320byte_cnt; intindex_tmp; byteunsigned[319: 0]derot2dedis_data_320byte_ary[]; byteunsigned[319: 0]dedis2fa_data_320byte_ary[]; byteunsignedoa1=8'hf6; byteunsignedoa2=8'h28; bit[47: 0]fas_tmp={derot2dedis_data_320b_que[0][319: 314], derot2dedis_data_320b_que[1][319: 314], derot2dedis_data_320b_que[2][319: 314]}; //====================cleartmpque===================== dedis2fa_data_256b_que.delete(); //====================checkdataque==================== if(derot2dedis_data_320b_que.size()! =408)//should1frame `uvm_info(get_type_name(),$sformatf("derot2dedis_data_320b_quesizeunnormal,should'd408,real%0d",derot2dedis_data_320b_que.size()),UVM_LOW) if(fas_tmp[47: 8]! ={oa1,oa1,oa1,oa2,oa2})//startofqueshouldfas `uvm_info(get_type_name(),$sformatf("derot2dedis_data_320b_quefasunnormal,should'hf6f6f62828,real%0h",fas_tmp[47: 8]),UVM_LOW) //====================dedisdata======================== if(derot2dedis_data_320b_que.size()%8)//8*320bit,meansdivisibleby320byte block_320byte_cnt++; derot2dedis_data_320byte_ary=new[block_320byte_cnt]; dedis2fa_data_320byte_ary=new[block_320byte_cnt]; derot2dedis_data_320byte_ary={>>{derot2dedis_data_320b_que}}; //-------------------------------------------------------- //dedis2fa_data_320byte_ary|derot2dedis_data_320byte_ary //0: 15320: 335|014041...280281 //16: 31336: 351|234243...282283 //......|...... //288: 303588: 623| //304: 319624: 639|38397980...319320 //-------------------------------------------------------- foreach(derot2dedis_data_320byte_ary[i]) for(intj=0;j<20;j++) for(intk=0;k<16;k++) begin index_tmp=2*j+(40*(k/2)+k%2); dedis2fa_data_320byte_ary[i][16*j+k]=derot2dedis_data_320byte_ary[i][index_tmp]; end dedis2fa_data_256b_que={>>{dedis2fa_data_320byte_ary}}; dedis2fa_data_256b_que=dedis2fa_data_que[0: (derot2dedis_data_320b_que.size()-1)]; endtask: dedis //============taskfa============= taskotu_fa(inputbit[255: 0]dedis2fa_data_256b_que[$], outputbitfa2descr_fp_que[$], outputbit[255: 0]fa2descr_data_256b_que[$]); bitoof=1'b1; intoof_cnt; bit[63: 0]data_64b_tmp; bitfa2descr_fp_ary_tmp[]; bit[63: 0]dedis2fa_data_64b_que[$]; bit[63: 0]dedis2fa_data_64b_tmp_que[$]; bit[63: 0]fa2descr_data_64b_tmp_que[$]; bit[255: 0]fa2descr_data_256b_que[$]; bit[255: 0]fa2descr_data_256b_tmp_que[$]; byteunsignedoa1=8'hf6; byteunsignedoa2=8'h28; dedis2fa_data_64b_que={>>{dedis2fa_data_256b_que}};//64bitslip while (1) begin if(oof)//OOF=1,findfas begin if(dedis2fa_data_64b_tmp_que.size()<2041)//4080*4*8/64=2040,findfas,needatleast2041*64bit dedis2fa_data_64b_tmp_que={dedis2fa_data_64b_tmp_que,dedis2fa_data_64b_que}; else begin if((dedis2fa_data_64b_tmp_que[0][256-8*0-1: 256-8*4]=={oa1,oa1,oa1,oa2}|| dedis2fa_data_64b_tmp_que[0][256-8*1-1: 256-8*5]=={oa1,oa1,oa2,oa2}|| dedis2fa_data_64b_tmp_que[0][256-8*2-1: 256-8*6]=={oa1,oa2,oa2,oa2})&& (dedis2fa_data_64b_tmp_que[2040][256-8*0-1: 256-8*4]=={oa1,oa1,oa1,oa2}|| dedis2fa_data_64b_tmp_que[2040][256-8*1-1: 256-8*5]=={oa1,oa1,oa2,oa2}|| dedis2fa_data_64b_tmp_que[2040][256-8*2-1: 256-8*6]=={oa1,oa2,oa2,oa2}))//OA1OA1OA1OA2,OA1OA1OA2OA2,OA1OA2OA2OA2; begin `uvm_info(get_type_name(),$sformatf("OTU4framealignment: OOF->IF! "),UVM_LOW) if(fa2descr_data_256b_tmp_que.size()! =0)//oof->if,sendremaindata begin fa2descr_fp_ary_tmp=new[fa2descr_data_256b_tmp_que.size()]; fa2descr_fp_ary_tmp[0]=1'b1; fa2descr_fp_que={>>{fa2descr_fp_ary_tmp}}; fa2descr_data_256b_que={>>{fa2descr_data_256b_tmp_que}}; fa2descr_data_256b_tmp_que.delete(); end oof=1'b0; end else begin data_64b_tmp=dedis2fa_data_64b_tmp_que.pop_front(); fa2descr_data_64b_tmp_que.push_back(data_64b_tmp); fa2descr_data_256b_tmp_que={>>{fa2descr_data_64b_tmp_que}}; if(fa2descr_data_256b_tmp_que.size()>510)//4080*4*8/256=510,inoof,shouldgeneratefpeveryframetime begin `uvm_info(get_type_name(),$sformatf("OTU4framealignmentOOFstate! "),UVM_LOW) fa2descr_data_256b_que=fa2descr_data_256b_tmp_que[0: 509]; fa2descr_data_256b_tmp_que=fa2descr_data_256b_tmp_que[510: $]; fa2descr_fp_ary_tmp=new[510]; fa2descr_fp_ary_tmp[0]=1'b1; fa2descr_fp_que={>>{fa2descr_fp_ary_tmp}}; end//if end// end// end//oof else//oof=0,InIFstate begin if(dedis2fa_data_64b_tmp_que.size()<2041) dedis2fa_data_64b_tmp_que={dedis2fa_data_64b_tmp_que,dedis2fa_data_64b_que}; else begin fa2descr_data_256b_que={>>{dedis2fa_data_64b_tmp_que[0: 2039]}}; dedis2fa_data_64b_tmp_que=dedis2fa_data_64b_tmp_que[2039: $]; fa2descr_fp_ary_tmp=new[510]; fa2descr_fp_ary_tmp[0]=1'b1; fa2descr_fp_que={>>{fa2descr_fp_ary_tmp}}; if(dedis2fa_data_64b_tmp_que[0][39: 8]! ={oa1,oa2,oa2})//byte3,4,5 oof_cnt++; else oof_cnt=0; if(oof_cnt==5) begin `uvm_info(get_type_name(),$sformatf("OTU4framealignment: IF->OOF! "),UVM_LOW) oof=1'b1; end end end end endtask: otu_fa taskotu_descr(inputbit[255: 0]fa2descr_data_256b_que[$], outputbit[255: 0]descr2defec_data_256b_que[$]); endtask: otu_descr taskdefec(inputbit[255: 0]descr2defec_data_256b_que[$], outputbit[255: 0]defec2scr_data_256b_que[$]); endtask: defec taskodu_scr(inputbit[255: 0]defec2scr_data_256_que[$], outputbit[255: 0]scr2tpce_data_256b_que[$]); endtask: scr tasktpce_if(inputbit[255: 0]scr2tpce_data_256b_que[$], outputbitotu2tpc_fp_que[$], outputbit[255: 0]otu2tpc_data_256b_que[$]); bit[255: 0]otu2tpc_data_256b_tmp_que[$]; bitotu2tpc_fp_ary[717]='{default: 0}; while (1) begin if(scr2tpce_data_256b_tmp_que.size()<717)//91776*2/256=717 scr2tpce_data_256b_tmp_que={scr2tpce_data_256b_tmp_que,scr2tpce_data_256b_que}; else begin otu2tpc_fp_ary[0]=1'b1; otu2tpc_fp_que={>>{otu2tpc_fp_ary}}; otu2tpc_data_256b_que=scr2tpce_data_256b_tmp_que[0: 716]; scr2tpce_data_256b_tmp_que=scr2tpce_data_256b_tmp_que[717: $]; end end endtask: tpce_if tasktpcdec_if(inputbit[255: 0]tpcdec_data_256b_que[$],
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- otuxrtask