2 * Copyright (c) 1998-2008 Stephen Williams (steve@icarus.com)
4 * This source code is free software; you can redistribute it
5 * and/or modify it in source code form under the terms of the GNU
6 * General Public License as published by the Free Software
7 * Foundation; either version 2 of the License, or (at your option)
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
23 * This file provides the pform_dump function, that dumps the module
24 * passed as a parameter. The dump is as much as possible in Verilog
25 * syntax, so that a human can tell that it really does describe the
30 # include "PGenerate.h"
36 ostream
& operator << (ostream
&out
, const PExpr
&obj
)
42 ostream
& operator << (ostream
&o
, const PDelays
&d
)
48 ostream
& operator<< (ostream
&o
, PGate::strength_t str
)
72 ostream
& operator<< (ostream
&out
, perm_string that
)
78 ostream
& operator<< (ostream
&out
, const index_component_t
&that
)
82 case index_component_t::SEL_BIT
:
85 case index_component_t::SEL_PART
:
86 out
<< *that
.msb
<< ":" << *that
.lsb
;
88 case index_component_t::SEL_IDX_UP
:
89 out
<< *that
.msb
<< "+:" << *that
.lsb
;
91 case index_component_t::SEL_IDX_DO
:
92 out
<< *that
.msb
<< "-:" << *that
.lsb
;
102 ostream
& operator<< (ostream
&out
, const name_component_t
&that
)
104 out
<< that
.name
.str();
106 typedef std::list
<index_component_t
>::const_iterator index_it_t
;
107 for (index_it_t idx
= that
.index
.begin()
108 ; idx
!= that
.index
.end() ; idx
++) {
115 ostream
& operator<< (ostream
&o
, const pform_name_t
&that
)
117 pform_name_t::const_iterator cur
;
123 while (cur
!= that
.end()) {
131 void PExpr::dump(ostream
&out
) const
133 out
<< typeid(*this).name();
136 void PEConcat::dump(ostream
&out
) const
139 out
<< "{" << *repeat_
;
141 if (parms_
.count() == 0) {
147 if (parms_
[0]) out
<< *parms_
[0];
148 for (unsigned idx
= 1 ; idx
< parms_
.count() ; idx
+= 1) {
150 if (parms_
[idx
]) out
<< *parms_
[idx
];
155 if (repeat_
) out
<< "}";
158 void PECallFunction::dump(ostream
&out
) const
162 if (parms_
.count() > 0) {
163 if (parms_
[0]) parms_
[0]->dump(out
);
164 for (unsigned idx
= 1; idx
< parms_
.count(); ++idx
) {
166 if (parms_
[idx
]) parms_
[idx
]->dump(out
);
172 void PEEvent::dump(ostream
&out
) const
175 case PEEvent::ANYEDGE
:
177 case PEEvent::POSEDGE
:
180 case PEEvent::NEGEDGE
:
183 case PEEvent::POSITIVE
:
191 void PEFNumber::dump(ostream
&out
) const
196 void PENumber::dump(ostream
&out
) const
201 void PEIdent::dump(ostream
&out
) const
206 void PEString::dump(ostream
&out
) const
208 out
<< "\"" << text_
<< "\"";
211 void PETernary::dump(ostream
&out
) const
213 out
<< "(" << *expr_
<< ")?(" << *tru_
<< "):(" << *fal_
<< ")";
216 void PEUnary::dump(ostream
&out
) const
226 out
<< "(" << *expr_
<< ")";
229 void PEBinary::dump(ostream
&out
) const
231 /* Handle some special cases, where the operators are written
232 in function notation. */
234 out
<< "min(" << *left_
<< "," << *right_
<< ")";
238 out
<< "min(" << *left_
<< "," << *right_
<< ")";
242 out
<< "(" << *left_
<< ")";
272 out
<< "(" << *right_
<< ")";
276 void PWire::dump(ostream
&out
, unsigned ind
) const
278 out
<< setw(ind
) << "" << type_
;
280 switch (port_type_
) {
281 case NetNet::PIMPLICIT
:
282 out
<< " implicit input";
287 case NetNet::POUTPUT
:
293 case NetNet::NOT_A_PORT
:
297 out
<< " " << data_type_
;
304 if (port_msb_
== 0) {
305 out
<< " port<scalar>";
307 out
<< " port[" << *port_msb_
<< ":" << *port_lsb_
<< "]";
312 out
<< " net<scalar>";
314 out
<< " net[" << *net_msb_
<< ":" << *net_lsb_
<< "]";
320 // If the wire has indices, dump them.
321 if (lidx_
|| ridx_
) {
323 if (lidx_
) out
<< *lidx_
;
324 if (ridx_
) out
<< ":" << *ridx_
;
329 for (map
<perm_string
,PExpr
*>::const_iterator idx
= attributes
.begin()
330 ; idx
!= attributes
.end()
332 out
<< " " << (*idx
).first
;
334 out
<< " = " << *(*idx
).second
;
339 void PGate::dump_pins(ostream
&out
) const
342 if (pin(0)) out
<< *pin(0);
344 for (unsigned idx
= 1 ; idx
< pin_count() ; idx
+= 1) {
346 if (pin(idx
)) out
<< *pin(idx
);
351 void PDelays::dump_delays(ostream
&out
) const
353 if (delay_
[0] && delay_
[1] && delay_
[2])
354 out
<< "#(" << *delay_
[0] << "," << *delay_
[1] << "," <<
357 out
<< "#" << *delay_
[0];
363 void PGate::dump_delays(ostream
&out
) const
365 delay_
.dump_delays(out
);
368 void PGate::dump(ostream
&out
, unsigned ind
) const
370 out
<< setw(ind
) << "" << typeid(*this).name() << " ";
371 delay_
.dump_delays(out
);
372 out
<< " " << get_name() << "(";
378 void PGAssign::dump(ostream
&out
, unsigned ind
) const
380 out
<< setw(ind
) << "";
381 out
<< "assign (" << strength0() << "0 " << strength1() << "1) ";
383 out
<< " " << *pin(0) << " = " << *pin(1) << ";" << endl
;
386 void PGBuiltin::dump(ostream
&out
, unsigned ind
) const
388 out
<< setw(ind
) << "";
390 case PGBuiltin::BUFIF0
:
393 case PGBuiltin::BUFIF1
:
396 case PGBuiltin::NOTIF0
:
399 case PGBuiltin::NOTIF1
:
402 case PGBuiltin::NAND
:
405 case PGBuiltin::NMOS
:
408 case PGBuiltin::RNMOS
:
411 case PGBuiltin::RPMOS
:
414 case PGBuiltin::PMOS
:
417 case PGBuiltin::RCMOS
:
420 case PGBuiltin::CMOS
:
424 out
<< "builtin gate ";
427 out
<< "(" << strength0() << "0 " << strength1() << "1) ";
429 out
<< " " << get_name();
432 out
<< " [" << *msb_
<< ":" << *lsb_
<< "]";
440 void PGModule::dump(ostream
&out
, unsigned ind
) const
442 out
<< setw(ind
) << "" << type_
<< " ";
444 // If parameters are overridden by order, dump them.
445 if (overrides_
&& overrides_
->count() > 0) {
449 if ((*overrides_
)[0] == 0)
452 out
<< *((*overrides_
)[0]);
453 for (unsigned idx
= 1 ; idx
< overrides_
->count() ; idx
+= 1) {
454 out
<< "," << *((*overrides_
)[idx
]);
459 // If parameters are overridden by name, dump them.
461 assert(overrides_
== 0);
463 out
<< "." << parms_
[0].name
<< "(" << *parms_
[0].parm
<< ")";
464 for (unsigned idx
= 1 ; idx
< nparms_
; idx
+= 1) {
465 out
<< ", ." << parms_
[idx
].name
<< "(" <<
466 *parms_
[idx
].parm
<< ")";
473 // If the module is arrayed, print the index expressions.
476 if (msb_
) out
<< *msb_
;
478 if (lsb_
) out
<< *lsb_
;
484 out
<< "." << pins_
[0].name
<< "(";
485 if (pins_
[0].parm
) out
<< *pins_
[0].parm
;
487 for (unsigned idx
= 1 ; idx
< npins_
; idx
+= 1) {
488 out
<< ", ." << pins_
[idx
].name
<< "(";
490 out
<< *pins_
[idx
].parm
;
499 void Statement::dump(ostream
&out
, unsigned ind
) const
501 /* I give up. I don't know what type this statement is,
502 so just print the C++ typeid and let the user figure
504 out
<< setw(ind
) << "";
505 out
<< "/* " << get_fileline() << ": " << typeid(*this).name()
509 void PAssign::dump(ostream
&out
, unsigned ind
) const
511 out
<< setw(ind
) << "";
512 out
<< *lval() << " = " << delay_
<< " " << *rval() << ";";
513 out
<< " /* " << get_fileline() << " */" << endl
;
516 void PAssignNB::dump(ostream
&out
, unsigned ind
) const
518 out
<< setw(ind
) << "";
519 out
<< *lval() << " <= " << delay_
<< " " << *rval() << ";";
520 out
<< " /* " << get_fileline() << " */" << endl
;
523 void PBlock::dump(ostream
&out
, unsigned ind
) const
525 out
<< setw(ind
) << "" << "begin";
526 if (pscope_name() != 0)
527 out
<< " : " << pscope_name();
530 if (pscope_name() != 0)
531 dump_wires_(out
, ind
+2);
533 for (unsigned idx
= 0 ; idx
< list_
.count() ; idx
+= 1) {
535 list_
[idx
]->dump(out
, ind
+2);
537 out
<< setw(ind
+2) << "" << "/* NOOP */ ;" << endl
;
540 out
<< setw(ind
) << "" << "end" << endl
;
543 void PCallTask::dump(ostream
&out
, unsigned ind
) const
545 out
<< setw(ind
) << "" << path_
;
547 if (parms_
.count() > 0) {
552 for (unsigned idx
= 1 ; idx
< parms_
.count() ; idx
+= 1) {
560 out
<< "; /* " << get_fileline() << " */" << endl
;
563 void PCase::dump(ostream
&out
, unsigned ind
) const
565 out
<< setw(ind
) << "";
577 out
<< " (" << *expr_
<< ") /* " << get_fileline() << " */" << endl
;
579 for (unsigned idx
= 0 ; idx
< items_
->count() ; idx
+= 1) {
580 PCase::Item
*cur
= (*items_
)[idx
];
582 if (cur
->expr
.count() == 0) {
583 out
<< setw(ind
+2) << "" << "default:";
586 out
<< setw(ind
+2) << "" << *cur
->expr
[0];
588 for(unsigned e
= 1 ; e
< cur
->expr
.count() ; e
+= 1)
589 out
<< ", " << *cur
->expr
[e
];
596 cur
->stat
->dump(out
, ind
+6);
602 out
<< setw(ind
) << "" << "endcase" << endl
;
605 void PCondit::dump(ostream
&out
, unsigned ind
) const
607 out
<< setw(ind
) << "" << "if (" << *expr_
<< ")" << endl
;
609 if_
->dump(out
, ind
+3);
611 out
<< setw(ind
) << ";" << endl
;
613 out
<< setw(ind
) << "" << "else" << endl
;
614 else_
->dump(out
, ind
+3);
618 void PCAssign::dump(ostream
&out
, unsigned ind
) const
620 out
<< setw(ind
) << "" << "assign " << *lval_
<< " = " << *expr_
621 << "; /* " << get_fileline() << " */" << endl
;
624 void PDeassign::dump(ostream
&out
, unsigned ind
) const
626 out
<< setw(ind
) << "" << "deassign " << *lval_
<< "; /* "
627 << get_fileline() << " */" << endl
;
630 void PDelayStatement::dump(ostream
&out
, unsigned ind
) const
632 out
<< setw(ind
) << "" << "#" << *delay_
<< " /* " <<
633 get_fileline() << " */";
636 statement_
->dump(out
, ind
+2);
638 out
<< " /* noop */;" << endl
;
642 void PDisable::dump(ostream
&out
, unsigned ind
) const
644 out
<< setw(ind
) << "" << "disable " << scope_
<< "; /* "
645 << get_fileline() << " */" << endl
;
648 void PEventStatement::dump(ostream
&out
, unsigned ind
) const
650 if (expr_
.count() == 0) {
651 out
<< setw(ind
) << "" << "@* ";
654 out
<< setw(ind
) << "" << "@(" << *(expr_
[0]);
655 if (expr_
.count() > 1)
656 for (unsigned idx
= 1 ; idx
< expr_
.count() ; idx
+= 1)
657 out
<< " or " << *(expr_
[idx
]);
664 statement_
->dump(out
, ind
+2);
670 void PForce::dump(ostream
&out
, unsigned ind
) const
672 out
<< setw(ind
) << "" << "force " << *lval_
<< " = " << *expr_
673 << "; /* " << get_fileline() << " */" << endl
;
676 void PForever::dump(ostream
&out
, unsigned ind
) const
678 out
<< setw(ind
) << "" << "forever /* " << get_fileline() << " */" << endl
;
679 statement_
->dump(out
, ind
+3);
682 void PForStatement::dump(ostream
&out
, unsigned ind
) const
684 out
<< setw(ind
) << "" << "for (" << *name1_
<< " = " << *expr1_
685 << "; " << *cond_
<< "; " << *name2_
<< " = " << *expr2_
<<
687 statement_
->dump(out
, ind
+3);
690 void PFunction::dump(ostream
&out
, unsigned ind
) const
692 out
<< setw(ind
) << "" << "function ";
693 switch (return_type_
.type
) {
717 if (return_type_
.range
) {
722 out
<< pscope_name() << ";" << endl
;
725 for (unsigned idx
= 0 ; idx
< ports_
->count() ; idx
+= 1) {
726 out
<< setw(ind
) << "";
728 out
<< (*ports_
)[idx
]->basename() << ";" << endl
;
731 dump_wires_(out
, ind
);
734 statement_
->dump(out
, ind
);
736 out
<< setw(ind
) << "" << "/* NOOP */" << endl
;
739 void PRelease::dump(ostream
&out
, unsigned ind
) const
741 out
<< setw(ind
) << "" << "release " << *lval_
<< "; /* "
742 << get_fileline() << " */" << endl
;
745 void PRepeat::dump(ostream
&out
, unsigned ind
) const
747 out
<< setw(ind
) << "" << "repeat (" << *expr_
<< ")" << endl
;
748 statement_
->dump(out
, ind
+3);
751 void PTask::dump(ostream
&out
, unsigned ind
) const
754 for (unsigned idx
= 0 ; idx
< ports_
->count() ; idx
+= 1) {
755 out
<< setw(ind
) << "";
756 switch ((*ports_
)[idx
]->get_port_type()) {
760 case NetNet::POUTPUT
:
770 out
<< (*ports_
)[idx
]->basename() << ";" << endl
;
773 dump_wires_(out
, ind
);
776 statement_
->dump(out
, ind
);
778 out
<< setw(ind
) << "" << "/* NOOP */" << endl
;
781 void PTrigger::dump(ostream
&out
, unsigned ind
) const
783 out
<< setw(ind
) << "" << "-> " << event_
<< ";" << endl
;
786 void PWhile::dump(ostream
&out
, unsigned ind
) const
788 out
<< setw(ind
) << "" << "while (" << *cond_
<< ")" << endl
;
789 statement_
->dump(out
, ind
+3);
792 void PProcess::dump(ostream
&out
, unsigned ind
) const
795 case PProcess::PR_INITIAL
:
796 out
<< setw(ind
) << "" << "initial";
798 case PProcess::PR_ALWAYS
:
799 out
<< setw(ind
) << "" << "always";
803 out
<< " /* " << get_fileline() << " */" << endl
;
805 for (map
<perm_string
,PExpr
*>::const_iterator idx
= attributes
.begin()
806 ; idx
!= attributes
.end() ; idx
++ ) {
808 out
<< setw(ind
+2) << "" << "(* " << (*idx
).first
;
810 out
<< " = " << *(*idx
).second
;
812 out
<< " *)" << endl
;
815 statement_
->dump(out
, ind
+2);
818 void PSpecPath::dump(std::ostream
&out
, unsigned ind
) const
820 out
<< setw(ind
) << "" << "specify path ";
823 out
<< "if (" << *condition
<< ") ";
833 for (unsigned idx
= 0 ; idx
< src
.size() ; idx
+= 1) {
834 if (idx
> 0) out
<< ", ";
841 if (data_source_expression
)
844 for (unsigned idx
= 0 ; idx
< dst
.size() ; idx
+= 1) {
845 if (idx
> 0) out
<< ", ";
850 if (data_source_expression
)
851 out
<< " : " << *data_source_expression
<< ")";
854 for (unsigned idx
= 0 ; idx
< delays
.size() ; idx
+= 1) {
855 if (idx
> 0) out
<< ", ";
862 void PGenerate::dump(ostream
&out
, unsigned indent
) const
864 out
<< setw(indent
) << "" << "generate(" << id_number
<< ")";
866 switch (scheme_type
) {
873 << "; " << *loop_test
874 << "; " << loop_index
875 << "=" << *loop_step
<< ")";
878 out
<< " if (" << *loop_test
<< ")";
881 out
<< " else !(" << *loop_test
<< ")";
884 out
<< " case (" << *loop_test
<< ")";
888 out
<< " (" << *loop_test
<< ") == (" << *parent
->loop_test
<< ")";
895 out
<< " : " << scope_name
;
899 for (map
<perm_string
,PWire
*>::const_iterator idx
= wires
.begin()
900 ; idx
!= wires
.end() ; idx
++) {
902 (*idx
).second
->dump(out
, indent
+2);
905 for (list
<PGate
*>::const_iterator idx
= gates
.begin()
906 ; idx
!= gates
.end() ; idx
++) {
907 (*idx
)->dump(out
, indent
+2);
910 for (list
<PProcess
*>::const_iterator idx
= behaviors
.begin()
911 ; idx
!= behaviors
.end() ; idx
++) {
912 (*idx
)->dump(out
, indent
+2);
915 for (list
<PGenerate
*>::const_iterator idx
= generates
.begin()
916 ; idx
!= generates
.end() ; idx
++) {
917 (*idx
)->dump(out
, indent
+2);
920 out
<< setw(indent
) << "" << "endgenerate" << endl
;
923 void PScope::dump_wires_(ostream
&out
, unsigned indent
) const
925 // Iterate through and display all the wires.
926 for (map
<perm_string
,PWire
*>::const_iterator wire
= wires
.begin()
927 ; wire
!= wires
.end() ; wire
++ ) {
929 (*wire
).second
->dump(out
, indent
);
933 void Module::dump(ostream
&out
) const
935 if (attributes
.begin() != attributes
.end()) {
937 for (map
<perm_string
,PExpr
*>::const_iterator idx
= attributes
.begin()
938 ; idx
!= attributes
.end() ; idx
++ ) {
939 if (idx
!= attributes
.begin()) {
944 out
<< " = " << *(*idx
).second
;
950 out
<< "module " << mod_name() << ";" << endl
;
952 for (unsigned idx
= 0 ; idx
< ports
.count() ; idx
+= 1) {
953 port_t
*cur
= ports
[idx
];
956 out
<< " unconnected" << endl
;
960 out
<< " ." << cur
->name
<< "(" << *cur
->expr
[0];
961 for (unsigned wdx
= 1 ; wdx
< cur
->expr
.count() ; wdx
+= 1) {
962 out
<< ", " << *cur
->expr
[wdx
];
968 typedef map
<perm_string
,param_expr_t
>::const_iterator parm_iter_t
;
969 typedef map
<pform_name_t
,PExpr
*>::const_iterator parm_hiter_t
;
970 for (parm_iter_t cur
= parameters
.begin()
971 ; cur
!= parameters
.end() ; cur
++) {
972 out
<< " parameter ";
973 if ((*cur
).second
.signed_flag
)
975 if ((*cur
).second
.msb
)
976 out
<< "[" << *(*cur
).second
.msb
<< ":"
977 << *(*cur
).second
.lsb
<< "] ";
978 out
<< (*cur
).first
<< " = ";
979 if ((*cur
).second
.expr
)
980 out
<< *(*cur
).second
.expr
<< ";" << endl
;
982 out
<< "/* ERROR */;" << endl
;
985 for (parm_iter_t cur
= localparams
.begin()
986 ; cur
!= localparams
.end() ; cur
++) {
987 out
<< " localparam ";
988 if ((*cur
).second
.msb
)
989 out
<< "[" << *(*cur
).second
.msb
<< ":"
990 << *(*cur
).second
.lsb
<< "] ";
991 out
<< (*cur
).first
<< " = ";
992 if ((*cur
).second
.expr
)
993 out
<< *(*cur
).second
.expr
<< ";" << endl
;
995 out
<< "/* ERROR */;" << endl
;
998 typedef list
<pair
<perm_string
,LineInfo
*> >::const_iterator genvar_iter_t
;
999 for (genvar_iter_t cur
= genvars
.begin()
1000 ; cur
!= genvars
.end() ; cur
++) {
1001 out
<< " genvar " << ((*cur
).first
) << ";" << endl
;
1004 typedef list
<PGenerate
*>::const_iterator genscheme_iter_t
;
1005 for (genscheme_iter_t cur
= generate_schemes
.begin()
1006 ; cur
!= generate_schemes
.end() ; cur
++) {
1007 (*cur
)->dump(out
, 4);
1010 typedef map
<perm_string
,PExpr
*>::const_iterator specparm_iter_t
;
1011 for (specparm_iter_t cur
= specparams
.begin()
1012 ; cur
!= specparams
.end() ; cur
++) {
1013 out
<< " specparam " << (*cur
).first
<< " = "
1014 << *(*cur
).second
<< ";" << endl
;
1017 for (parm_hiter_t cur
= defparms
.begin()
1018 ; cur
!= defparms
.end() ; cur
++) {
1019 out
<< " defparam " << (*cur
).first
<< " = ";
1021 out
<< *(*cur
).second
<< ";" << endl
;
1023 out
<< "/* ERROR */;" << endl
;
1026 for (map
<perm_string
,PEvent
*>::const_iterator cur
= events
.begin()
1027 ; cur
!= events
.end() ; cur
++ ) {
1028 PEvent
*ev
= (*cur
).second
;
1029 out
<< " event " << ev
->name() << "; // "
1030 << ev
->get_fileline() << endl
;
1033 // Iterate through and display all the wires.
1034 dump_wires_(out
, 4);
1036 // Dump the task definitions.
1037 typedef map
<perm_string
,PTask
*>::const_iterator task_iter_t
;
1038 for (task_iter_t cur
= tasks_
.begin()
1039 ; cur
!= tasks_
.end() ; cur
++) {
1040 out
<< " task " << (*cur
).first
<< ";" << endl
;
1041 (*cur
).second
->dump(out
, 6);
1042 out
<< " endtask;" << endl
;
1045 // Dump the function definitions.
1046 typedef map
<perm_string
,PFunction
*>::const_iterator func_iter_t
;
1047 for (func_iter_t cur
= funcs_
.begin()
1048 ; cur
!= funcs_
.end() ; cur
++) {
1049 out
<< " function " << (*cur
).first
<< ";" << endl
;
1050 (*cur
).second
->dump(out
, 6);
1051 out
<< " endfunction;" << endl
;
1055 // Iterate through and display all the gates
1056 for (list
<PGate
*>::const_iterator gate
= gates_
.begin()
1057 ; gate
!= gates_
.end()
1064 for (list
<PProcess
*>::const_iterator behav
= behaviors
.begin()
1065 ; behav
!= behaviors
.end()
1068 (*behav
)->dump(out
, 4);
1071 for (list
<PSpecPath
*>::const_iterator spec
= specify_paths
.begin()
1072 ; spec
!= specify_paths
.end()
1075 (*spec
)->dump(out
, 4);
1078 out
<< "endmodule" << endl
;
1081 void pform_dump(ostream
&out
, Module
*mod
)
1086 void PUdp::dump(ostream
&out
) const
1088 out
<< "primitive " << name_
<< "(" << ports
[0];
1089 for (unsigned idx
= 1 ; idx
< ports
.count() ; idx
+= 1)
1090 out
<< ", " << ports
[idx
];
1091 out
<< ");" << endl
;
1094 out
<< " reg " << ports
[0] << ";" << endl
;
1096 out
<< " table" << endl
;
1097 for (unsigned idx
= 0 ; idx
< tinput
.count() ; idx
+= 1) {
1099 for (unsigned chr
= 0 ; chr
< tinput
[idx
].length() ; chr
+= 1)
1100 out
<< " " << tinput
[idx
][chr
];
1103 out
<< " : " << tcurrent
[idx
];
1105 out
<< " : " << toutput
[idx
] << " ;" << endl
;
1107 out
<< " endtable" << endl
;
1110 out
<< " initial " << ports
[0] << " = 1'b" << initial
1113 // Dump the attributes for the primitive as attribute
1115 for (map
<string
,PExpr
*>::const_iterator idx
= attributes
.begin()
1116 ; idx
!= attributes
.end()
1118 out
<< " attribute " << (*idx
).first
;
1120 out
<< " = " << *(*idx
).second
;
1124 out
<< "endprimitive" << endl
;