|
|
Go to the documentation of this file. 13 #define For(par1, par2, par3) glc.setprintassign(0); std::cout << glc.getmargin() << "for (" << flush; std::cout << (par1).getname() << "; " << flush; glc.setprintassign(0); std::cout << (par2).getname() << "; " << flush; glc.setprintassign(0); std::cout << (par3).getname(); std::cout << ") " << flush; glc.setprintassign(1); glc.enablemargin(0); 15 #define For(par1, par2, par3) for ((par1); ((par2).getbool()); (par3)) 19 #define If(par) glc.setprintassign(0); std::cout << glc.getmargin() << "if (" << flush; std::cout << (par).getname(); std::cout << ") " << flush; glc.setprintassign(1); glc.enablemargin(0); 21 #define If(par) if ((par).getbool()) 25 #define Else std::cout << glc.getmargin() << "else " << flush; glc.enablemargin(0); 30 #define begin vbegin() 32 #define vbegin() glc.enablemargin(1); std::cout << "\n" << glc.getmargin() << "begin\n" << flush; glc.Indent(); 34 #define vbegin() { glc.alwayspush(); 39 #define vend() glc.Outdent(); std::cout << glc.getmargin() << "end\n" << flush; 41 #define vend() glc.alwayspop(); } 45 #define always(par) std::cout << glc.getmargin() << "always @(" << (par).getorname() << ") " << flush; glc.enablemargin(0); 47 #define always(par) glc.alwaysstart(); if ((par).getchange()) 51 #define assign std::cout << glc.getmargin() << "assign " << flush; glc.enablemargin(0); 57 #define deassign(par) std::cout << glc.getmargin() << "deassign " << flush; std::cout << (par).getname() << ";\n" << flush; glc.enablemargin(1); 59 #define deassign(par) ; 63 #define begincase(par) glc.setprintassign(0); std::cout << glc.getmargin() << "case (" << flush; std::cout << (par).getcatname() << flush; std::cout << ")\n" << flush; glc.setprintassign(1); glc.Indent(); 65 #define begincase(par) pushswitch((par)); if (0) {} 68 #define endcase vendcase() 70 #define vendcase() glc.Outdent(); std::cout << glc.getmargin() << "endcase\n" << flush; 72 #define vendcase() popswitch(); 77 cout << glc.getmargin(); \ 78 glc.setprintassign(0); std::cout << ((Signal)(par)).getcatname(); \ 79 cout << " : " << flush; glc.setprintassign(1); glc.enablemargin(0); 81 #define case1(par) else if ((getswitch() == (par)).getbool()) 85 #define case2(par1, par2) \ 86 glc.setprintassign(0); \ 87 cout << glc.getmargin(); \ 88 glc.setprintassign(0); std::cout << ((Signal)(par1)).getcatname(); std::cout << ", "; \ 89 glc.setprintassign(0); std::cout << ((Signal)(par2)).getcatname();\ 90 cout << " : " << flush; glc.setprintassign(1); glc.enablemargin(0); 92 #define case2(par1, par2) else if ( (getswitch() == (par1)).getbool() || (getswitch() == (par2)).getbool()) 96 #define case3(par1, par2, par3) \ 97 glc.setprintassign(0); \ 98 cout << glc.getmargin(); \ 99 glc.setprintassign(0); std::cout << ((Signal)(par1)).getcatname(); std::cout << ", "; \ 100 glc.setprintassign(0); std::cout << ((Signal)(par2)).getcatname(); std::cout << ", "; \ 101 glc.setprintassign(0); std::cout << ((Signal)(par3)).getcatname(); \ 102 cout << " : " << flush; glc.setprintassign(1); glc.enablemargin(0); 104 #define case3(par1, par2, par3) else if ( (getswitch() == (par1)).getbool() || (getswitch() == (par2)).getbool() || (getswitch() == (par3)).getbool()) 108 #define Default vdefault() 110 #define vdefault() std::cout << glc.getmargin(); std::cout << "default : " << flush; glc.enablemargin(0); 112 #define vdefault() else 115 #define beginmodule vbeginmodule(); 116 #define endmodule vendmodule(); 122 if (glc.getpassn() != passn) \ 127 passn = glc.getpassn(); \ 128 if (!glc.getparent()->getchange()) \ 140 #define beginfunction vbeginfunction(); 141 #define endfunction vendfunction(); return (result); 151 #if (__GNUC__==2)||defined(_MSC_VER) 156 #define endperiod glc.ResetEvents(); 159 #define comment(par) if (glc.getFileOpen()) {std::cout << glc.getmargin(); std::cout << (par) << "\n" << flush;} else glc.AddComment((string)(par)); 165 #define printv(par) std::cout << (par) << flush; 172 #define initio glc.setparent(this); glc.setFileOpen(0); 174 #define initio glc.setparent(this); glc.getparent()->setchange(0); 180 #define Reg(cl) cl.reg(#cl) 181 #define Reg_(cl, h, l) cl.reg(h, l, #cl) 182 #define Reg__(cl, h, l, t, b) cl.reg(h, l, t, b, #cl); 184 #define Wire(cl) cl.wire(#cl) 185 #define Wire_(cl, h, l) cl.wire(h, l, #cl) 186 #define Wire__(cl, h, l, t, b) for (int __wi__ = b; __wi__ <= t; __wi__++) cl[__wi__].wire(h, l, #cl, __wi__) 188 #define Input(cl) cl.input(#cl) 189 #define Input_(cl, h, l) cl.input(h, l, #cl) 190 #define Clock(cl) cl.clock(#cl) 192 #define Output(cl) cl.output(#cl) 193 #define Output_(cl, h, l) cl.output(h, l, #cl) 195 #define OutReg(cl) cl.output(#cl, makereg) 196 #define OutReg_(cl, h, l) cl.output(h, l, #cl, makereg) 198 #define Inout(cl) cl.inout(#cl) 199 #define Inout_(cl, h, l) cl.inout(h, l, #cl) 201 #define Module(md) md.init(#md, #md) 202 #define Module_(md, fn) md.init(#md, #fn) 204 #define cns(b,v) glc.constant(b,v)