|
|
Go to the documentation of this file.
15 #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);
17 #define For(par1, par2, par3) for ((par1); ((par2).getbool()); (par3))
21 #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);
23 #define If(par) if ((par).getbool())
27 #define Else std::cout << glc.getmargin() << "else " << flush; glc.enablemargin(0);
32 #define begin vbegin()
34 #define vbegin() glc.enablemargin(1); std::cout << "\n" << glc.getmargin() << "begin\n" << flush; glc.Indent();
36 #define vbegin() { glc.alwayspush();
41 #define vend() glc.Outdent(); std::cout << glc.getmargin() << "end\n" << flush;
43 #define vend() glc.alwayspop(); }
47 #define always(par) std::cout << glc.getmargin() << "always @(" << (par).getorname() << ") " << flush; glc.enablemargin(0);
49 #define always(par) glc.alwaysstart(); if ((par).getchange())
53 #define assign std::cout << glc.getmargin() << "assign " << flush; glc.enablemargin(0);
59 #define deassign(par) std::cout << glc.getmargin() << "deassign " << flush; std::cout << (par).getname() << ";\n" << flush; glc.enablemargin(1);
61 #define deassign(par) ;
65 #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();
67 #define begincase(par) pushswitch((par)); if (0) {}
70 #define endcase vendcase()
72 #define vendcase() glc.Outdent(); std::cout << glc.getmargin() << "endcase\n" << flush;
74 #define vendcase() popswitch();
79 cout << glc.getmargin(); \
80 glc.setprintassign(0); std::cout << ((Signal)(par)).getcatname(); \
81 cout << " : " << flush; glc.setprintassign(1); glc.enablemargin(0);
83 #define case1(par) else if ((getswitch() == (par)).getbool())
87 #define case2(par1, par2) \
88 glc.setprintassign(0); \
89 cout << glc.getmargin(); \
90 glc.setprintassign(0); std::cout << ((Signal)(par1)).getcatname(); std::cout << ", "; \
91 glc.setprintassign(0); std::cout << ((Signal)(par2)).getcatname();\
92 cout << " : " << flush; glc.setprintassign(1); glc.enablemargin(0);
94 #define case2(par1, par2) else if ( (getswitch() == (par1)).getbool() || (getswitch() == (par2)).getbool())
98 #define case3(par1, par2, par3) \
99 glc.setprintassign(0); \
100 cout << glc.getmargin(); \
101 glc.setprintassign(0); std::cout << ((Signal)(par1)).getcatname(); std::cout << ", "; \
102 glc.setprintassign(0); std::cout << ((Signal)(par2)).getcatname(); std::cout << ", "; \
103 glc.setprintassign(0); std::cout << ((Signal)(par3)).getcatname(); \
104 cout << " : " << flush; glc.setprintassign(1); glc.enablemargin(0);
106 #define case3(par1, par2, par3) else if ( (getswitch() == (par1)).getbool() || (getswitch() == (par2)).getbool() || (getswitch() == (par3)).getbool())
110 #define Default vdefault()
112 #define vdefault() std::cout << glc.getmargin(); std::cout << "default : " << flush; glc.enablemargin(0);
114 #define vdefault() else
117 #define beginmodule vbeginmodule();
118 #define endmodule vendmodule();
124 if (glc.getpassn() != passn) \
129 passn = glc.getpassn(); \
130 if (!glc.getparent()->getchange()) \
142 #define beginfunction vbeginfunction();
143 #define endfunction vendfunction(); return (result);
153 #if (__GNUC__==2)||defined(_MSC_VER)
158 #define endperiod glc.ResetEvents();
161 #define comment(par) if (glc.getFileOpen()) {std::cout << glc.getmargin(); std::cout << (par) << "\n" << flush;} else glc.AddComment((string)(par));
167 #define printv(par) std::cout << (par) << flush;
174 #define initio glc.setparent(this); glc.setFileOpen(0);
176 #define initio glc.setparent(this); glc.getparent()->setchange(0);
182 #define Reg(cl) cl.reg(#cl)
183 #define Reg_(cl, h, l) cl.reg(h, l, #cl)
184 #define Reg__(cl, h, l, t, b) cl.reg(h, l, t, b, #cl);
186 #define Wire(cl) cl.wire(#cl)
187 #define Wire_(cl, h, l) cl.wire(h, l, #cl)
188 #define Wire__(cl, h, l, t, b) for (int __wi__ = b; __wi__ <= t; __wi__++) cl[__wi__].wire(h, l, #cl, __wi__)
190 #define Input(cl) cl.input(#cl)
191 #define Input_(cl, h, l) cl.input(h, l, #cl)
192 #define Clock(cl) cl.clock(#cl)
194 #define Output(cl) cl.output(#cl)
195 #define Output_(cl, h, l) cl.output(h, l, #cl)
197 #define OutReg(cl) cl.output(#cl, makereg)
198 #define OutReg_(cl, h, l) cl.output(h, l, #cl, makereg)
200 #define Inout(cl) cl.inout(#cl)
201 #define Inout_(cl, h, l) cl.inout(h, l, #cl)
203 #define Module(md) md.init(#md, #md)
204 #define Module_(md, fn) md.init(#md, #fn)
206 #define cns(b,v) glc.constant(b,v)