Hi,
I'm using TT 2.11, Perl 5.6.0 on RedHat Linux 7.1, PIV-2.4, 2GB RAM.
Overall, the tool is just wonderful -- I don't see anybody coming close in expressive power, features, flexibility.
In our flow, TT is used to generate code in multiple labguages, like C++, Verilog and others.
Unfortunately, I have a performance problem running templates like described below and I'm asking for your suggestions.
Perhaps the data structure that I choose is not optimal, or their exist some config options that might speed up the generation, or something else...
I declare a long sequence of SET commands, looking like:
======================================================================
[% Gbexp.1 = ['F_carry_chain_start_0_length_1', 57, '"chain.pni"', '"F_carry_chain_start_0_length_1"',1] -%]
[% Gbexp.2 = ['F_carry_chain_start_0_length_10', 57, '"chain.pni"', '"F_carry_chain_start_0_length_10"',1] -%]
[% Gbexp.3 = ['F_carry_chain_start_0_length_100', 57, '"chain.pni"', '"F_carry_chain_start_0_length_100"',1] -%]
… and so forth… -- we have ~17K lines
[% Gbexp.17030 = ['T_carry_chain_start_9_length_99', 65, '"chain.pni"', '"T_carry_chain_start_9_length_99"',1] -%]
[% Gbexp.17031 = ['five_cycle_f0', 88, '"chain.pni"', '"five_cycle_f0"',1] -%]
[% Gbexp.17032 = ['write_back_f6', 92, '"chain.pni"', '"write_back_f6"',1] -%]
[% Gbexps_num = 17032 -%]
[% INCLUDE vlog.template -%]
======================================================================
Now, vlog.template is a simple TT template that looks like:
======================================================================
function expressions;
input in;
reg junk;
begin
[% FOREACH i = [1 .. Gbexps_num] -%]
junk =
`line [%-Gbexp.${i}.1 %] [%Gbexp.${i}.2 %]
([% Gbexp.${i}.0 %])
&& ([% Gbexp.${i}.3 %]);
[% END -%]
end
endfunction
======================================================================
The template is processed in ~3 minutes user+system time on my system, which seems to be too slow for this quite simple example (we have templates at least order of magnitude bigger than this one).
Another data that might be useful:
- Template::Stash::XS is configured ON.
- 'gtime' reports an unusually huge number of minor page faults (~25mln.)
Any suggestions?
Thanks in advance,
=======================
Igor Bely
DV-Technologies Group
Logic Validation Tecnologies, DT
Intel Israel
iNET: 8-465-6140
Tel: +972 4 865-6140
