Throughout wishbone.pl, string comparison operators are frequently used where integer comparison should be used. This causes bugs 1728, 322 and 200. Attached is a patch to use the correct operators.
(If the file is mangled by the bugtracker, download it here: http://blankertz.org/~matthias/wb_builder-21-comparison.patch )
--- wishbone.pl (revision 21) +++ wishbone.pl (working copy) @@ -739,7 +739,7 @@ printf OUTFILE "adr_size=%s\n",$adr_size; printf OUTFILE "mux_type=%s\n",$mux_type; printf OUTFILE "interconnect=%s\n",$interconnect;
for ($j=1; $j le $slaves; $j++) {
for ($j=1; $j <= $slaves; $j++) {
printf OUTFILE " priority_%s=%s\n",$slave[$j]{"wbs"},$master[$i]{"priority_".($slave[$j]{"wbs"})};
};
};
printf OUTFILE "end master %s\n",$master$i{"wbm"};
}; if ($master[$i]{"err_i"} eq 1) { printf OUTFILE " err_i : std_logic;\n";};
if ($master[$i]{"rty_i"} eq 1) { printf OUTFILE " rty_i : std_logic;\n";};
if ($master[$i]{"err_i"} == 1) { printf OUTFILE " err_i : std_logic;\n";};
if ($master[$i]{"rty_i"} == 1) { printf OUTFILE " rty_i : std_logic;\n";};
printf OUTFILE " ack_i : std_logic;\n";
printf OUTFILE "end record;\n";
# output record
@@ -822,39 +822,39 @@
if ($master$i{"type"} =~ /(wo|rw)/) {
printf OUTFILE " dat_o : std_logic_vector(%s downto 0);\n",$master$i{"dat_size"}-1;
printf OUTFILE " we_o : std_logic;\n"; }; if ($dat_size eq 8) {
if ($dat_size == 8) {
printf OUTFILE " sel_o : std_logic;\n";
} else {
printf OUTFILE " sel_o : std_logic_vector(%s downto 0);\n",$dat_size/8-1; };
printf OUTFILE " adr_o : std_logic_vector(%s downto 0);\n",$adr_size-1;
if ($master[$i]{"lock_o"} eq 1) { printf OUTFILE " lock_o : std_logic;\n";};
if ($master[$i]{"tga_o"} eq 1) { printf OUTFILE " %s_o : std_logic_vector(%s downto 0);\n",$rename_tga, $tga_bits-1;};
if ($master[$i]{"tgc_o"} eq 1) { printf OUTFILE " %s_o : std_logic_vector(%s downto 0);\n",$rename_tgc, $tgc_bits-1;};
if ($master[$i]{"lock_o"} == 1) { printf OUTFILE " lock_o : std_logic;\n";};
if ($master[$i]{"tga_o"} == 1) { printf OUTFILE " %s_o : std_logic_vector(%s downto 0);\n",$rename_tga, $tga_bits-1;};
if ($master[$i]{"tgc_o"} == 1) { printf OUTFILE " %s_o : std_logic_vector(%s downto 0);\n",$rename_tgc, $tgc_bits-1;};
printf OUTFILE " cyc_o : std_logic;\n";
printf OUTFILE " stb_o : std_logic;\n";
printf OUTFILE "end record;\n\n";
}; #end for if ($dat_size eq 8) {
if ($dat_size == 8) {
printf OUTFILE " sel_i : std_logic;\n";
} else {
printf OUTFILE " sel_i : std_logic_vector(%s downto 0);\n",$dat_size/8-1; };
if ($slave[$i]{"adr_i_hi"} gt 0) { printf OUTFILE " adr_i : std_logic_vector(%s downto %s);\n",$slave[$i]{"adr_i_hi"},$slave[$i]{"adr_i_lo"};};
if ($slave[$i]{"tga_i"} eq 1) { printf OUTFILE " %s_i : std_logic_vector(%s downto 0);\n",$rename_tga,$tga_bits-1; };
if ($slave[$i]{"tgc_i"} eq 1) { printf OUTFILE " %s_i : std_logic_vector(%s downto 0);\n",$rename_tgc,$tgc_bits-1; };
if ($slave[$i]{"adr_i_hi"} > 0) { printf OUTFILE " adr_i : std_logic_vector(%s downto %s);\n",$slave[$i]{"adr_i_hi"},$slave[$i]{"adr_i_lo"};};
if ($slave[$i]{"tga_i"} == 1) { printf OUTFILE " %s_i : std_logic_vector(%s downto 0);\n",$rename_tga,$tga_bits-1; };
if ($slave[$i]{"tgc_i"} == 1) { printf OUTFILE " %s_i : std_logic_vector(%s downto 0);\n",$rename_tgc,$tgc_bits-1; };
printf OUTFILE " cyc_i : std_logic;\n";
printf OUTFILE " stb_i : std_logic;\n";
printf OUTFILE "end record;\n";
# output record
printf OUTFILE "type %s_wbs_o_type is record\n",$slave[$i]{"wbs"};
if ($slave[$i]{"type"} =~ /(ro|rw)/) { printf OUTFILE " dat_o : std_logic_vector(%s downto 0);\n",$slave[$i]{"dat_size"}-1 };
if ($slave[$i]{"rty_o"} eq 1) { printf OUTFILE " rty_o : std_logic;\n" };
if ($slave[$i]{"err_o"} eq 1) { printf OUTFILE " err_o : std_logic;\n" };
if ($slave[$i]{"rty_o"} == 1) { printf OUTFILE " rty_o : std_logic;\n" };
if ($slave[$i]{"err_o"} == 1) { printf OUTFILE " err_o : std_logic;\n" };
printf OUTFILE " ack_o : std_logic;\n";
printf OUTFILE "end record;\n";
}; #end for
@@ -1028,14 +1028,14 @@
if ($signal_groups eq 1) { # master port(s)
printf OUTFILE " -- wishbone master port(s)\n";
if ($dat_size ge 16) {
if ($dat_size >= 16) {
printf OUTFILE " %s_sel_o : in std_logic_vector(%s downto 0);\n",$master[$i]{"wbm"},$dat_size/8-1; };
printf OUTFILE " %s_adr_o : in std_logic_vector(%s downto 0);\n",$master[$i]{"wbm"},$adr_size-1;
if ($master[$i]{"tgc_o"} eq 1) {
@@ -1067,7 +1067,7 @@
printf OUTFILE " %s_stb_o : in std_logic;\n",$master$i{"wbm"};
};
printf OUTFILE " -- wishbone slave port(s)\n"; if ($dat_size ge 16) {
if ($dat_size >= 16) {
printf OUTFILE " %s_sel_i : out std_logic_vector(%s downto 0);\n",$slave[$i]{"wbs"},$dat_size/8-1; };
printf OUTFILE " %s_adr_i : out std_logic_vector(%s downto %s);\n",$slave[$i]{"wbs"},$slave[$i]{"adr_i_hi"},$slave[$i]{"adr_i_lo"};
if ($slave[$i]{"tgc_i"} eq 1) {
@@ -1102,13 +1102,13 @@ # slave select for generation of stb_i to slaves
for ($j=1; $j le $slaves; $j++) {
if ($master[$i]{("priority_".($slave[$j]{"wbs"}))} ne 0) {
for ($j=1; $j <= $slaves; $j++) {
if ($master[$i]{("priority_".($slave[$j]{"wbs"}))} != 0) {
printf OUTFILE " signal %s_%s_ss : std_logic; -- slave select\n",$master[$i]{"wbm"},$slave[$j]{"wbs"};
printf OUTFILE " signal %s_%s_bg : std_logic; -- bus grant\n",$master[$i]{"wbm"},$slave[$j]{"wbs"};
};
@@ -1194,18 +1194,18 @@ # _bg_q
# bg eq 1 => set
# end of cycle => reset
if ($master[$i]{"tgc_o"} eq 1) {
if ($master[$i]{"tgc_o"} == 1) {
printf OUTFILE " and (%s_%s_o=\"%s\" or %s_%s_o=\"%s\")",$master[$i]{"wbm"},$rename_tgc,$classic,$master[$i]{"wbm"},$rename_tgc,$endofburst; };
printf OUTFILE " then\n %s_bg_q <= '0';\nend if;\nend if;\nend process;\n",$master[$i]{"wbm"};
}; # end forfor ($i=2; $i <= $masters; $i++) { printf OUTFILE "%s_bg_1 <= '1' when idle='1' and %s_cyc_o='1' and %s_trafic_ctrl_limit='0' and (%s) else '0';\n",$master$i{"wbm"},$master$i{"wbm"},$master$i{"wbm"},$depend; $depend = $depend." and ".$master$i{"wbm"}."_bg_1='0'"; };
printf OUTFILE "%s_bg_2 <= '1' when idle='1' and (%s) and %s_cyc_o='1' else '0';\n",$master1{"wbm"},$depend,$master1{"wbm"}; $depend = $depend." and ".$master1{"wbm"}."_bg_2='0'";
for ($l=1; $l le $masters; $l++) {
if ($master[$l]{("priority_".($slave[$j]{"wbs"}))} ne 0) {
for ($l=1; $l <= $masters; $l++) {
if ($master[$l]{("priority_".($slave[$j]{"wbs"}))} != 0) {
$only_master = $l;
$tmp++;
};
@@ -1272,8 +1272,8 @@
printf OUTFILE "%s%s_bg <= %s%sss and %s_cyc_o;\n",$master$only_master{"wbm"},$slave$j{"wbs"},$master$only_master{"wbm"},$slave$j{"wbs"},$master$only_master{"wbm"};
} else {
printf OUTFILE "arbiter%s : block\n",$slave$j{"wbs"}; for ($i=1; $i le $masters; $i++) {
if ($master[$i]{("priority_".($slave[$j]{"wbs"}))} ne 0) {
for ($i=1; $i <= $masters; $i++) {
if ($master[$i]{("priority_".($slave[$j]{"wbs"}))} != 0) {
printf OUTFILE " signal %s_bg, %s_bg_1, %s_bg_2, %s_bg_q : std_logic;\n",$master[$i]{"wbm"},$master[$i]{"wbm"},$master[$i]{"wbm"},$master[$i]{"wbm"};
printf OUTFILE " signal %s_trafic_limit : std_logic;\n",$master[$i]{"wbm"};
};
@@ -1284,10 +1284,10 @@ # instantiate trafic_supervision(s)
# calc tot priority per slave
$priority = 0;
for ($i=1; $i le $masters; $i++) {
for ($i=1; $i <= $masters; $i++) {
$priority += $master[$i]{("priority_".($slave[$j]{"wbs"}))}; };
for ($i=1; $i le $masters; $i++) {
if ($master[$i]{("priority_".($slave[$j]{"wbs"}))} ne 0) {
for ($i=1; $i <= $masters; $i++) {
if ($master[$i]{("priority_".($slave[$j]{"wbs"}))} != 0) {
printf OUTFILE "\ntrafic_supervision_%s : entity work.trafic_supervision\n",$i;
printf OUTFILE "generic map(\n";
printf OUTFILE " priority => %s,\n",$master[$i]{("priority_".($slave[$j]{"wbs"}))};
@@ -1303,33 +1303,33 @@ # _bg_q
# bg eq 1 => set
# end of cycle => reset
for ($i=1; $i le $masters; $i++) {
if ($master[$i]{("priority_".($slave[$j]{"wbs"}))} ne 0) {
for ($i=1; $i <= $masters; $i++) {
if ($master[$i]{("priority_".($slave[$j]{"wbs"}))} != 0) {
printf OUTFILE "\nprocess(clk,reset)\nbegin\nif reset='1' then\n";
printf OUTFILE " %s_bg_q <= '0';\n",$master[$i]{"wbm"};
printf OUTFILE "elsif clk'event and clk='1' then\n";
printf OUTFILE "if %s_bg_q='0' then\n",$master[$i]{"wbm"};
printf OUTFILE " %s_bg_q <= %s_bg;\n",$master[$i]{"wbm"},$master[$i]{"wbm"};
printf OUTFILE "elsif ack='1'";
if ($master[$i]{"tgc_o"} eq 1) {
if ($master[$i]{"tgc_o"} == 1) {
printf OUTFILE " and (%s_%s_o=\"%s\" or %s_%s_o=\"%s\")",$master[$i]{"wbm"},$rename_tgc,$classic,$master[$i]{"wbm"},$rename_tgc,$endofburst; };
printf OUTFILE " then\n %s_bg_q <= '0';\nend if;\nend if;\nend process;\n",$master[$i]{"wbm"};
};
}; # end for
# _bg
$depend = "";
$tmp=1; until ($master[$tmp]{("priority_".($slave[$j]{"wbs"}))} ne 0) {$tmp++};
$tmp=1; until ($master[$tmp]{("priority_".($slave[$j]{"wbs"}))} != 0) {$tmp++};
printf OUTFILE "\nidle <= '1' when %s_bg_q='0'",$master[$tmp]{"wbm"};
for ($i=$tmp+1; $i le $masters; $i++) {
if ($master[$i]{("priority_".($slave[$j]{"wbs"}))} ne 0) {
for ($i=$tmp+1; $i <= $masters; $i++) {
if ($master[$i]{("priority_".($slave[$j]{"wbs"}))} != 0) {
printf OUTFILE " and %s_bg_q='0'",$master[$i]{"wbm"};
};
};
printf OUTFILE " else '0';\n";
printf OUTFILE "%s_bg_1 <= '1' when idle='1' and %s_cyc_o='1' and %s_%s_ss='1' and %s_trafic_limit='0' else '0';\n",$master[$tmp]{"wbm"},$master[$tmp]{"wbm"},$master[$tmp]{"wbm"},$slave[$j]{"wbs"},$master[$tmp]{"wbm"};
$depend = $master[$tmp]{"wbm"}."_bg_1='0'",;
for ($i=$tmp+1; $i le $masters; $i++) {
if ($master[$i]{("priority_".($slave[$j]{"wbs"}))} ne 0) {
for ($i=$tmp+1; $i <= $masters; $i++) {
if ($master[$i]{("priority_".($slave[$j]{"wbs"}))} != 0) {
printf OUTFILE "%sbg_1 <= '1' when idle='1' and (%s) and %s_cyc_o='1' and %s%sss='1' and %s_trafic_limit='0' else '0';\n",$master$i{"wbm"},$depend,$master$i{"wbm"},$master$i{"wbm"},$slave$j{"wbs"},$master$i{"wbm"},$slave$j{"wbs"},$master$i{"wbm"};;
$depend = $depend." and ".$master$i{"wbm"}."_bg_1='0'";
};
@@ -1337,29 +1337,29 @@
printf OUTFILE "%s_bg_2 <= '1' when idle='1' and (%s) and %s_cyc_o='1' and %s%s_ss='1' else '0';\n",$master$tmp{"wbm"},$depend,$master$tmp{"wbm"},$master$tmp{"wbm"},$slave$j{"wbs"};
$depend = $depend." and ".$master$tmp{"wbm"}."_bg_2='0'";
$tmp1 = $tmp; for ($i=$tmp+1; $i le $masters; $i++) {
if ($master[$i]{("priority_".($slave[$j]{"wbs"}))} ne 0) {
for ($i=$tmp+1; $i <= $masters; $i++) {
if ($master[$i]{("priority_".($slave[$j]{"wbs"}))} != 0) {
printf OUTFILE "%s_bg_2 <= '1' when idle='1' and (%s) and %s_cyc_o='1' and %s_%s_ss='1' else '0';\n",$master[$i]{"wbm"},$depend,$master[$i]{"wbm"},$master[$i]{"wbm"},$slave[$j]{"wbs"};
$depend = $depend." and ".$master[$i]{"wbm"}."_bg_2='0'";
};
};
for ($i=1; $i le $masters; $i++) {
if ($master[$i]{("priority_".($slave[$j]{"wbs"}))} ne 0) {
for ($i=1; $i <= $masters; $i++) {
if ($master[$i]{("priority_".($slave[$j]{"wbs"}))} != 0) {
printf OUTFILE "%s_bg <= %s_bg_q or %s_bg_1 or %s_bg_2;\n",$master[$i]{"wbm"},$master[$i]{"wbm"},$master[$i]{"wbm"},$master[$i]{"wbm"};
};
};
# ce
$tmp=1; until ($master[$tmp]{("priority_".($slave[$j]{"wbs"}))} ne 0) {$tmp++};
$tmp=1; until ($master[$tmp]{("priority_".($slave[$j]{"wbs"}))} != 0) {$tmp++};
printf OUTFILE "ce <= (%s_cyc_o and %s_%s_ss)",$master[$tmp]{"wbm"},$master[$tmp]{"wbm"},$slave[$j]{"wbs"};
for ($i=$tmp+1; $i le $masters; $i++) {
if ($master[$i]{("priority_".($slave[$j]{"wbs"}))} ne 0) {
for ($i=$tmp+1; $i <= $masters; $i++) {
if ($master[$i]{("priority_".($slave[$j]{"wbs"}))} != 0) {
printf OUTFILE " or (%s_cyc_o and %s_%s_ss)",$master[$i]{"wbm"},$master[$i]{"wbm"},$slave[$j]{"wbs"};
};
};
printf OUTFILE " when idle='1' else '0';\n";
# global bg
for ($i=1; $i le $masters; $i++) {
if ($master[$i]{("priority_".($slave[$j]{"wbs"}))} ne 0) {
for ($i=1; $i <= $masters; $i++) {
if ($master[$i]{("priority_".($slave[$j]{"wbs"}))} != 0) {
printf OUTFILE "%s_%s_bg <= %s_bg;\n",$master[$i]{"wbm"},$slave[$j]{"wbs"},$master[$i]{"wbm"};
};
};
@@ -1376,16 +1376,16 @@
printf OUTFILE "begin\n"; # adr
printf OUTFILE "adr <= (%s_adr_o and %s_bg)",$master[1]{"wbm"},$master[1]{"wbm"};
for ($i=2; $i le $masters; $i++) {
for ($i=2; $i <= $masters; $i++) {
printf OUTFILE " or (%s_adr_o and %s_bg)",$master[$i]{"wbm"},$master[$i]{"wbm"}; };
};
printf OUTFILE ";\n"; for ($j=$adr_size-1; $j ge (log(hex($slave[$i]{"size"}))/log(2)); $j--) {
for ($j=$adr_size-1; $j >= (log(hex($slave[$i]{"size"}))/log(2)); $j--) {
if (($slave[$i]{"baseadr"}) >= (2**$j)) {
$slave[$i]{"baseadr"} -= 2**$j;
printf OUTFILE "1";
@@ -1395,10 +1395,10 @@
};
printf OUTFILE "\""; # 1
if ($slave[$i]{"size1"} ne "ffffffff") {
if (hex($slave[$i]{"size1"}) != hex("ffffffff")) {
printf OUTFILE " else\n'1' when adr(%s downto %s)=\"",$adr_size-1,log(hex($slave[$i]{"size1"}))/log(2);
$slave[$i]{"baseadr1"}=hex($slave[$i]{"baseadr1"});
for ($j=$adr_size-1; $j ge (log(hex($slave[$i]{"size1"}))/log(2)); $j--) {
for ($j=$adr_size-1; $j >= (log(hex($slave[$i]{"size1"}))/log(2)); $j--) {
if (($slave$i{"baseadr1"}) >= (2$j)) {
$slave$i{"baseadr1"} -= 2$j;
printf OUTFILE "1";
@@ -1409,10 +1409,10 @@
printf OUTFILE "\"";
}; # 2
if ($slave[$i]{"size2"} ne "ffffffff") {
if (hex($slave[$i]{"size2"}) != hex("ffffffff")) {
printf OUTFILE " else\n'1' when adr(%s downto %s)=\"",$adr_size-1,log(hex($slave[$i]{"size2"}))/log(2);
$slave[$i]{"baseadr2"}=hex($slave[$i]{"baseadr2"});
for ($j=$adr_size-1; $j ge (log(hex($slave[$i]{"size2"}))/log(2)); $j--) {
for ($j=$adr_size-1; $j >= (log(hex($slave[$i]{"size2"}))/log(2)); $j--) {
if (($slave$i{"baseadr2"}) >= (2$j)) {
$slave$i{"baseadr2"} -= 2$j;
printf OUTFILE "1";
@@ -1423,10 +1423,10 @@
printf OUTFILE "\"";
}; # 3
if ($slave[$i]{"size3"} ne "ffffffff") {
if (hex($slave[$i]{"size3"}) != hex("ffffffff")) {
printf OUTFILE " else\n'1' when adr(%s downto %s)=\"",$adr_size-1,log(hex($slave[$i]{"size3"}))/log(2);
$slave[$i]{"baseadr3"}=hex($slave[$i]{"baseadr3"});
for ($j=$adr_size-1; $j ge (log(hex($slave[$i]{"size3"}))/log(2)); $j--) {
for ($j=$adr_size-1; $j >= (log(hex($slave[$i]{"size3"}))/log(2)); $j--) {
if (($slave$i{"baseadr3"}) >= (2$j)) {
$slave$i{"baseadr3"} -= 2$j;
printf OUTFILE "1";
@@ -1439,20 +1439,20 @@
printf OUTFILE " else\n'0';\n"; # adr to slaves
};
# master_slave_ss
for ($j=1; $j le $slaves; $j++) {
if ($master[$i]{("priority_".($slave[$j]{"wbs"}))} ne 0) {
for ($j=1; $j <= $slaves; $j++) {
if ($master[$i]{("priority_".($slave[$j]{"wbs"}))} != 0) {
printf OUTFILE "%s_%s_ss <= '1' when %s_adr_o(%s downto %s)=\"",$master[$i]{"wbm"},$slave[$j]{"wbs"},$master[$i]{"wbm"},$adr_size-1,log(hex($slave[$j]{"size"}))/log(2);
$tmp=hex($slave[$j]{"baseadr"});
for ($k=$adr_size-1; $k ge (log(hex($slave[$j]{"size"}))/log(2)); $k--) {
for ($k=$adr_size-1; $k >= (log(hex($slave[$j]{"size"}))/log(2)); $k--) {
if ($tmp >= (2**$k)) {
$tmp -= 2**$k;
printf OUTFILE "1";
@@ -1462,10 +1462,10 @@
};
printf OUTFILE "\""; # 2?
if ($slave[$j]{"size1"} ne "ffffffff") {
if (hex($slave[$j]{"size1"}) != hex("ffffffff")) {
printf OUTFILE " else\n'1' when %s_adr_o(%s downto %s)=\"",$master[$i]{"wbm"},$adr_size-1,log(hex($slave[$j]{"size1"}))/log(2);
$tmp=hex($slave[$j]{"baseadr1"});
for ($k=$adr_size-1; $k ge (log(hex($slave[$j]{"size1"}))/log(2)); $k--) {
for ($k=$adr_size-1; $k >= (log(hex($slave[$j]{"size1"}))/log(2)); $k--) {
if ($tmp >= (2$k)) {
$tmp -= 2$k;
printf OUTFILE "1";
@@ -1476,10 +1476,10 @@
printf OUTFILE "\"";
}; # 3?
if ($slave[$j]{"size2"} ne "ffffffff") {
if (hex($slave[$j]{"size2"}) != hex("ffffffff")) {
printf OUTFILE " else\n'1' when %s_adr_o(%s downto %s)=\"",$master[$i]{"wbm"},$adr_size-1,log(hex($slave[$j]{"size2"}))/log(2);
$tmp=hex($slave[$j]{"baseadr2"});
for ($k=$adr_size-1; $k ge (log(hex($slave[$j]{"size2"}))/log(2)); $k--) {
for ($k=$adr_size-1; $k >= (log(hex($slave[$j]{"size2"}))/log(2)); $k--) {
if ($tmp >= (2$k)) {
$tmp -= 2$k;
printf OUTFILE "1";
@@ -1494,22 +1494,22 @@
};
}; # _adr_o
for ($l=1; $l le $masters; $l++) {
if ($master[$l]{("priority_".($slave[$i]{"wbs"}))} ne 0) {
for ($l=1; $l <= $masters; $l++) {
if ($master[$l]{("priority_".($slave[$i]{"wbs"}))} != 0) {
$tmp++;
};
};
if ($tmp eq 1) {
$k=1; until ($master[$k]{("priority_".($slave[$i]{"wbs"}))} ne 0) {$k++};
$k=1; until ($master[$k]{("priority_".($slave[$i]{"wbs"}))} != 0) {$k++};
printf OUTFILE "%s_adr_i <= %s_adr_o(%s downto %s);\n",$slave[$i]{"wbs"},$master[$k]{"wbm"},$slave[$i]{"adr_i_hi"},$slave[$i]{"adr_i_lo"};
} else {
$k=1; until ($master[$k]{("priority_".($slave[$i]{"wbs"}))} ne 0) {$k++};
$k=1; until ($master[$k]{("priority_".($slave[$i]{"wbs"}))} != 0) {$k++};
printf OUTFILE "%s_adr_i <= (%s_adr_o(%s downto %s) and %s_%s_bg)",$slave[$i]{"wbs"},$master[$k]{"wbm"},$slave[$i]{"adr_i_hi"},$slave[$i]{"adr_i_lo"},$master[$k]{"wbm"},$slave[$i]{"wbs"};
for ($j=$k+1; $j le $masters; $j++) {
if ($master[$j]{("priority_".($slave[$i]{"wbs"}))} ne 0) {
for ($j=$k+1; $j <= $masters; $j++) {
if ($master[$j]{("priority_".($slave[$i]{"wbs"}))} != 0) {
printf OUTFILE " or (%s_adr_o(%s downto %s) and %s_%s_bg)",$master[$j]{"wbm"},$slave[$i]{"adr_i_hi"},$slave[$i]{"adr_i_lo"},$master[$j]{"wbm"},$slave[$i]{"wbs"};
};
};
@@ -1523,9 +1523,9 @@
sub gen_muxshb{
printf OUTFILE "mux: block\n";
printf OUTFILE " signal cyc, stb, we, ack : std_logic;\n"; for ($i=2; $i le $masters; $i++) {
for ($i=2; $i <= $masters; $i++) {
printf OUTFILE " or (%s_cyc_o and %s_bg)",$master[$i]{"wbm"},$master[$i]{"wbm"}; };
};
printf OUTFILE ";\n"; for ($i=2; $i le $masters; $i++) {
for ($i=2; $i <= $masters; $i++) {
printf OUTFILE " or (%s_stb_o and %s_bg)",$master[$i]{"wbm"},$master[$i]{"wbm"}; };
};
printf OUTFILE ";\n"; for ($j=$i+1; $j le $masters; $j++) {
for ($j=$i+1; $j <= $masters; $j++) {
if ($master[$j]{"type"} ne "ro") {
printf OUTFILE " or (%s_we_o and %s_bg)",$master[$j]{"wbm"},$master[$j]{"wbm"};
};
};
};
printf OUTFILE ";\n"; for ($i=1; $i le $masters; $i++) {
if ($master[$i]{"rty_i"} eq 1) {
for ($i=1; $i <= $masters; $i++) {
if ($master[$i]{"rty_i"} == 1) {
printf OUTFILE "%s_rty_i <= '0';\n",$master[$i]{"wbm"};
};
};
$i=1; until ($slave[$i]{"rty_o"} eq 1) {$i++};
for ($j=1; $j le $masters; $j++) {
if ($master[$j]{"rty_i"} eq 1) {
$i=1; until ($slave[$i]{"rty_o"} == 1) {$i++};
for ($j=1; $j <= $masters; $j++) {
if ($master[$j]{"rty_i"} == 1) {
printf OUTFILE "%s_rty_i <= %s_rty_o;\n",$master[$j]{"wbm"},$slave[$i]{"wbs"};
};
};
$i=1; until ($slave[$i]{"rty_o"} eq 1) {$i++};
$i=1; until ($slave[$i]{"rty_o"} == 1) {$i++};
printf OUTFILE "rty <= %s_rty_o",$slave[$i]{"wbs"};
for ($j=$i+1; $j le $slaves; $j++) {
if ($slave[$j]{"rty_o"} eq 1) {
for ($j=$i+1; $j <= $slaves; $j++) {
if ($slave[$j]{"rty_o"} == 1) {
printf OUTFILE " or %s_rty_o",$slave[$j]{"wbs"};
};
};
printf OUTFILE ";\n";
for ($i=1; $i le $masters; $i++) {
if ($master[$i]{"rty_i"} eq 1) {
for ($i=1; $i <= $masters; $i++) {
if ($master[$i]{"rty_i"} == 1) {
printf OUTFILE "%s_rty_i <= rty;\n",$master[$i]{"wbm"};
};
};
}; for ($i=1; $i le $masters; $i++) {
if ($master[$i]{"err_i"} eq 1) {
for ($i=1; $i <= $masters; $i++) {
if ($master[$i]{"err_i"} == 1) {
printf OUTFILE "%s_err_i <= '0';\n",$master[$i]{"wbm"};
};
};
$i=1; until ($slave[$i]{"err_o"} eq 1) {$i++};
for ($j=1; $j le $masters; $j++) {
if ($master[$j]{"err_i"} eq 1) {
$i=1; until ($slave[$i]{"err_o"} == 1) {$i++};
for ($j=1; $j <= $masters; $j++) {
if ($master[$j]{"err_i"} == 1) {
printf OUTFILE "%s_err_i <= %s_err_o;\n",$master[$j]{"wbm"},$slave[$i]{"wbs"};
};
};
$i=1; until ($slave[$i]{"err_o"} eq 1) {$i++};
$i=1; until ($slave[$i]{"err_o"} == 1) {$i++};
printf OUTFILE "err <= %s_err_o",$slave[$i]{"wbs"};
for ($j=$i+1; $j le $slaves; $j++) {
if ($slave[$j]{"err_o"} eq 1) {
for ($j=$i+1; $j <= $slaves; $j++) {
if ($slave[$j]{"err_o"} == 1) {
printf OUTFILE " or %s_err_o",$slave[$j]{"wbs"};
};
};
printf OUTFILE ";\n";
for ($i=1; $i le $masters; $i++) {
if ($master[$i]{"err_i"} eq 1) {
for ($i=1; $i <= $masters; $i++) {
if ($master[$i]{"err_i"} == 1) {
printf OUTFILE "%s_err_i <= err;\n",$master[$i]{"wbm"};
};
};
}; for ($i=2; $i le $masters; $i++) {
for ($i=2; $i <= $masters; $i++) {
printf OUTFILE " or (%s_sel_o and %s_bg)",$master[$i]{"wbm"},$master[$i]{"wbm"};
};
};
printf OUTFILE ";\n"; for ($j=$i+1; $j le $masters; $j++) {
for ($j=$i+1; $j <= $masters; $j++) {
printf OUTFILE " or (%s_dat_o and %s_bg)",$master[$j]{"wbm"},$master[$j]{"wbm"};
};
};
printf OUTFILE ";\n"; # data s2m
$i=1; until ($slave[$i]{"type"} ne "wo") {$i++};
printf OUTFILE "dat_s2m <= (%s_dat_o and %s_ss)",$slave[$i]{"wbs"},$slave[$i]{"wbs"};
for ($j=$i+1; $j le $slaves; $j++) {
for ($j=$i+1; $j <= $slaves; $j++) {
printf OUTFILE " or (%s_dat_o and %s_ss)",$slave[$j]{"wbs"},$slave[$j]{"wbs"};
};
};
printf OUTFILE ";\n"; for ($i=1; $i le $slaves; $i++) {
if ($slave[$i]{"tgc_i"} eq 1) {
for ($i=1; $i <= $slaves; $i++) {
if ($slave[$i]{"tgc_i"} == 1) {
printf OUTFILE "%s_%s_i <= %s;\n",$slave[$i]{"wbs"},$rename_tgc,$classic;
};
};
$i=1; until ($master[$i]{"tgc_o"} eq 1) {$i++};
$i=1; until ($master[$i]{"tgc_o"} == 1) {$i++};
printf OUTFILE "tgc <= (%s_%s_o and %s_bg)",$master[$i]{"wbm"},$rename_tgc,$master[$i]{"wbm"};
for ($j=$i+1; $j le $masters; $j++) {
if ($master[$j]{"tgc_o"} eq 1) {
for ($j=$i+1; $j <= $masters; $j++) {
if ($master[$j]{"tgc_o"} == 1) {
printf OUTFILE " or (%s_%s_o and %s_bg)",$master[$j]{"wbm"},$rename_tgc,$master[$j]{"wbm"};
};
};
printf OUTFILE ";\n";
for ($i=1; $i le $slaves; $i++) {
if ($slave[$i]{"tgc_i"} eq 1) {
for ($i=1; $i <= $slaves; $i++) {
if ($slave[$i]{"tgc_i"} == 1) {
printf OUTFILE "%s_%s_i <= tgc;\n",$slave[$i]{"wbs"},$rename_tgc,$slave[$i]{"wbs"};
};
};
}; for ($i=1; $i le $slaves; $i++) {
if ($slave[$i]{"tga_i"} eq 1) {
for ($i=1; $i <= $slaves; $i++) {
if ($slave[$i]{"tga_i"} == 1) {
printf OUTFILE "%s_%s_i <= (others=>'0');\n",$slave[$i]{"wbs"},$rename_tga;
};
};
$i=1; until ($master[$i]{"tga_o"} eq 1) {$i++};
$i=1; until ($master[$i]{"tga_o"} == 1) {$i++};
printf OUTFILE "tga <= (%s_%s_o and %s_bg)",$master[$i]{"wbm"},$rename_tga,$master[$i]{"wbm"};
for ($j=$i+1; $j le $masters; $j++) {
if ($master[$j]{"tga_o"} eq 1) {
for ($j=$i+1; $j <= $masters; $j++) {
if ($master[$j]{"tga_o"} == 1) {
printf OUTFILE " or (%s_%s_o and %s_bg)",$master[$j]{"wbm"},$rename_tga,$master[$j]{"wbm"};
};
};
printf OUTFILE ";\n";
for ($i=1; $i le $slaves; $i++) {
if ($slave[$i]{"tga_i"} eq 1) {
for ($i=1; $i <= $slaves; $i++) {
if ($slave[$i]{"tga_i"} == 1) {
printf OUTFILE "%s_%s_i <= tga;\n",$slave[$i]{"wbs"},$rename_tga,$slave[$i]{"wbs"};
};
};
@@ -1726,11 +1726,11 @@
sub gen_muxcbs{ # cyc
printf OUTFILE "-- cyc_i(s)\n";
$tmp=1; until ($master[$tmp]{("priority_".($slave[$i]{"wbs"}))} ne 0) {$tmp++};
$tmp=1; until ($master[$tmp]{("priority_".($slave[$i]{"wbs"}))} != 0) {$tmp++};
printf OUTFILE "%s_cyc_i <= (%s_cyc_o and %s_%s_bg)",$slave[$i]{"wbs"},$master[$tmp]{"wbm"},$master[$tmp]{"wbm"},$slave[$i]{"wbs"};
for ($j=$tmp+1; $j le $masters; $j++) {
if ($master[$j]{("priority_".($slave[$i]{"wbs"}))} ne 0) {
for ($j=$tmp+1; $j <= $masters; $j++) {
if ($master[$j]{("priority_".($slave[$i]{"wbs"}))} != 0) {
printf OUTFILE " or (%s_cyc_o and %s_%s_bg)",$master[$j]{"wbm"},$master[$j]{"wbm"},$slave[$i]{"wbs"};
};
};
@@ -1738,11 +1738,11 @@
}; # stb
printf OUTFILE "-- stb_i(s)\n";
$tmp=1; until ($master[$tmp]{("priority_".($slave[$i]{"wbs"}))} ne 0) {$tmp++};
$tmp=1; until ($master[$tmp]{("priority_".($slave[$i]{"wbs"}))} != 0) {$tmp++};
printf OUTFILE "%s_stb_i <= (%s_stb_o and %s_%s_bg)",$slave[$i]{"wbs"},$master[$tmp]{"wbm"},$master[$tmp]{"wbm"},$slave[$i]{"wbs"};
for ($j=$tmp+1; $j le $masters; $j++) {
if ($master[$j]{("priority_".($slave[$i]{"wbs"}))} ne 0) {
for ($j=$tmp+1; $j <= $masters; $j++) {
if ($master[$j]{("priority_".($slave[$i]{"wbs"}))} != 0) {
printf OUTFILE " or (%s_stb_o and %s_%s_bg)",$master[$j]{"wbm"},$master[$j]{"wbm"},$slave[$i]{"wbs"};
};
};
@@ -1750,12 +1750,12 @@
}; # we
printf OUTFILE "-- we_i(s)\n";
$tmp=1; until (($master[$tmp]{("priority_".($slave[$i]{"wbs"}))} ne 0) && ($master[$tmp]{"type"} ne "ro")) {$tmp++};
$tmp=1; until (($master[$tmp]{("priority_".($slave[$i]{"wbs"}))} != 0) && ($master[$tmp]{"type"} ne "ro")) {$tmp++};
printf OUTFILE "%s_we_i <= (%s_we_o and %s_%s_bg)",$slave[$i]{"wbs"},$master[$tmp]{"wbm"},$master[$tmp]{"wbm"},$slave[$i]{"wbs"};
for ($j=$tmp+1; $j le $masters; $j++) {
if (($master[$j]{("priority_".($slave[$i]{"wbs"}))} ne 0) && ($master[$j]{"type"} ne "ro")) {
for ($j=$tmp+1; $j <= $masters; $j++) {
if (($master[$j]{("priority_".($slave[$i]{"wbs"}))} != 0) && ($master[$j]{"type"} ne "ro")) {
printf OUTFILE " or (%s_we_o and %s_%s_bg)",$master[$j]{"wbm"},$master[$j]{"wbm"},$slave[$i]{"wbs"};
};
};
@@ -1764,11 +1764,11 @@
}; # ack
printf OUTFILE "-- ack_i(s)\n";
$tmp=1; until ($master[$i]{("priority_".($slave[$tmp]{"wbs"}))} ne 0) {$tmp++};
$tmp=1; until ($master[$i]{("priority_".($slave[$tmp]{"wbs"}))} != 0) {$tmp++};
printf OUTFILE "%s_ack_i <= (%s_ack_o and %s_%s_bg)",$master[$i]{"wbm"},$slave[$tmp]{"wbs"},$master[$i]{"wbm"},$slave[$tmp]{"wbs"};
for ($j=$tmp+1; $j le $slaves; $j++) {
if ($master[$i]{("priority_".($slave[$j]{"wbs"}))} ne 0) {
for ($j=$tmp+1; $j <= $slaves; $j++) {
if ($master[$i]{("priority_".($slave[$j]{"wbs"}))} != 0) {
printf OUTFILE " or (%s_ack_o and %s_%s_bg)",$slave[$j]{"wbs"},$master[$i]{"wbm"},$slave[$j]{"wbs"};
};
};
@@ -1776,21 +1776,21 @@
}; # rty
printf OUTFILE "-- rty_i(s)\n";
if ($master[$i]{"rty_i"} eq 1) {
if ($master[$i]{"rty_i"} == 1) {
$rty_o=0;
for ($j=1; $j le $masters; $j++) {
if (($slave[$j]{"rty_o"} eq 1) && ($master[$i]{("priority_".($slave[$j]{"wbs"}))} ne 0)) {
for ($j=1; $j <= $masters; $j++) {
if (($slave[$j]{"rty_o"} == 1) && ($master[$i]{("priority_".($slave[$j]{"wbs"}))} != 0)) {
$rty_o+=1;
};
};
if ($rty_o eq 0) {
if ($rty_o == 0) {
printf OUTFILE "%s_rty_i <= '0';\n",$master[$i]{"wbm"};
} else {
$tmp=1; until ($master[$i]{("priority_".($slave[$tmp]{"wbs"}))} ne 0) {$tmp++};
$tmp=1; until ($master[$i]{("priority_".($slave[$tmp]{"wbs"}))} != 0) {$tmp++};
printf OUTFILE "%s_rty_i <= (%s_rty_o and %s_%s_bg)",$master[$i]{"wbm"},$slave[$tmp]{"wbs"},$master[$i]{"wbm"},$slave[$tmp]{"wbs"};
for ($j=$tmp+1; $j le $slaves; $j++) {
if ($master[$i]{("priority_".($slave[$j]{"wbs"}))} ne 0) {
for ($j=$tmp+1; $j <= $slaves; $j++) {
if ($master[$i]{("priority_".($slave[$j]{"wbs"}))} != 0) {
printf OUTFILE " or (%s_rty_o and %s_%s_bg)",$slave[$j]{"wbs"},$master[$i]{"wbm"},$slave[$j]{"wbs"};
};
};
@@ -1800,21 +1800,21 @@
}; # err
printf OUTFILE "-- err_i(s)\n";
if ($master[$i]{"err_i"} eq 1) {
if ($master[$i]{"err_i"} == 1) {
$err_o=0;
for ($j=1; $j le $masters; $j++) {
if (($slave[$j]{"err_o"} eq 1) && ($master[$i]{("priority_".($slave[$j]{"wbs"}))} ne 0)) {
for ($j=1; $j <= $masters; $j++) {
if (($slave[$j]{"err_o"} == 1) && ($master[$i]{("priority_".($slave[$j]{"wbs"}))} != 0)) {
$err_o+=1;
};
};
if ($err_o eq 0) {
if ($err_o == 0) {
printf OUTFILE "%s_err_i <= '0';\n",$master[$i]{"wbm"};
} else {
$tmp=1; until ($master[$i]{("priority_".($slave[$tmp]{"wbs"}))} ne 0) {$tmp++};
$tmp=1; until ($master[$i]{("priority_".($slave[$tmp]{"wbs"}))} != 0) {$tmp++};
printf OUTFILE "%s_err_i <= (%s_err_o and %s_%s_bg)",$master[$i]{"wbm"},$slave[$tmp]{"wbs"},$master[$i]{"wbm"},$slave[$tmp]{"wbs"};
for ($j=$tmp+1; $j le $slaves; $j++) {
if ($master[$i]{("priority_".($slave[$j]{"wbs"}))} ne 0) {
for ($j=$tmp+1; $j <= $slaves; $j++) {
if ($master[$i]{("priority_".($slave[$j]{"wbs"}))} != 0) {
printf OUTFILE " or (%s_err_o and %s_%s_bg)",$slave[$j]{"wbs"},$master[$i]{"wbm"},$slave[$j]{"wbs"};
};
};
@@ -1824,12 +1824,12 @@
}; # sel
printf OUTFILE "-- sel_i(s)\n";
$tmp=1; until ($master[$tmp]{("priority_".($slave[$i]{"wbs"}))} ne 0) {$tmp++};
$tmp=1; until ($master[$tmp]{("priority_".($slave[$i]{"wbs"}))} != 0) {$tmp++};
printf OUTFILE "%s_sel_i <= (%s_sel_o and %s_%s_bg)",$slave[$i]{"wbs"},$master[$tmp]{"wbm"},$master[$tmp]{"wbm"},$slave[$i]{"wbs"};
for ($j=$tmp+1; $j le $masters; $j++) {
if ($master[$j]{("priority_".($slave[$i]{"wbs"}))} ne 0) {
for ($j=$tmp+1; $j <= $masters; $j++) {
if ($master[$j]{("priority_".($slave[$i]{"wbs"}))} != 0) {
printf OUTFILE " or (%s_sel_o and %s_%s_bg)",$master[$j]{"wbm"},$master[$j]{"wbm"},$slave[$i]{"wbs"};
};
};
@@ -1838,22 +1838,22 @@
}; # dat
printf OUTFILE "-- slave dat_i(s)\n";
for ($j=1; $j le $masters; $j++) {
if (($master[$j]{("priority_".($slave[$i]{"wbs"}))} ne 0) && ($master[$j]{"type"} ne "ro")) {
for ($j=1; $j <= $masters; $j++) {
if (($master[$j]{("priority_".($slave[$i]{"wbs"}))} != 0) && ($master[$j]{"type"} ne "ro")) {
$tmp+=1;
};
};
if ($tmp eq 1) {
$j=1; until (($master[$j]{("priority_".($slave[$i]{"wbs"}))} ne 0) && ($master[$j]{"type"} ne "ro")) {$j++};
if ($tmp == 1) {
$j=1; until (($master[$j]{("priority_".($slave[$i]{"wbs"}))} != 0) && ($master[$j]{"type"} ne "ro")) {$j++};
printf OUTFILE "%s_dat_i <= %s_dat_o;\n",$slave[$i]{"wbs"},$master[$j]{"wbm"};
} elsif ($tmp >= 1) {
$tmp=1; until (($master[$tmp]{("priority_".($slave[$i]{"wbs"}))} ne 0) && ($master[$tmp]{"type"} ne "ro")) {$tmp++};
$tmp=1; until (($master[$tmp]{("priority_".($slave[$i]{"wbs"}))} != 0) && ($master[$tmp]{"type"} ne "ro")) {$tmp++};
printf OUTFILE "%s_dat_i <= (%s_dat_o and %s_%s_bg)",$slave[$i]{"wbs"},$master[$tmp]{"wbm"},$master[$tmp]{"wbm"},$slave[$i]{"wbs"};
for ($j=$tmp+1; $j le $masters; $j++) {
if (($master[$j]{("priority_".($slave[$i]{"wbs"}))} ne 0) && ($master[$j]{"type"} ne "ro")) {
for ($j=$tmp+1; $j <= $masters; $j++) {
if (($master[$j]{("priority_".($slave[$i]{"wbs"}))} != 0) && ($master[$j]{"type"} ne "ro")) {
printf OUTFILE " or (%s_dat_o and %s_%s_bg)",$master[$j]{"wbm"},$master[$j]{"wbm"},$slave[$i]{"wbs"};
};
};
@@ -1862,22 +1862,22 @@
};
};
printf OUTFILE "-- master dat_i(s)\n"; for ($j=1; $j le $slaves; $j++) {
if ($master[$i]{("priority_".($slave[$j]{"wbs"}))} ne 0) {
for ($j=1; $j <= $slaves; $j++) {
if ($master[$i]{("priority_".($slave[$j]{"wbs"}))} != 0) {
$tmp+=1;
};
};
if ($tmp eq 1) {
$tmp=1; until ($master[$i]{("priority_".($slave[$tmp]{"wbs"}))} ne 0) {$tmp++};
if ($tmp == 1) {
$tmp=1; until ($master[$i]{("priority_".($slave[$tmp]{"wbs"}))} != 0) {$tmp++};
printf OUTFILE "%s_dat_i <= %s_dat_o",$master[$i]{"wbm"},$slave[$tmp]{"wbs"};
} else {
$tmp=1; until ($master[$i]{("priority_".($slave[$tmp]{"wbs"}))} ne 0) {$tmp++};
$tmp=1; until ($master[$i]{("priority_".($slave[$tmp]{"wbs"}))} != 0) {$tmp++};
printf OUTFILE "%s_dat_i <= (%s_dat_o and %s_%s_bg)",$master[$i]{"wbm"},$slave[$tmp]{"wbs"},$master[$i]{"wbm"},$slave[$tmp]{"wbs"};
for ($j=$tmp+1; $j le $slaves; $j++) {
if (($master[$i]{("priority_".($slave[$j]{"wbs"}))} ne 0) && ($master[$i]{"type"} ne "wo")) {
for ($j=$tmp+1; $j <= $slaves; $j++) {
if (($master[$i]{("priority_".($slave[$j]{"wbs"}))} != 0) && ($master[$i]{"type"} ne "wo")) {
printf OUTFILE " or (%s_dat_o and %s_%s_bg)",$slave[$j]{"wbs"},$master[$i]{"wbm"},$slave[$j]{"wbs"};
};
};
@@ -1887,23 +1887,23 @@
}; # tgc
printf OUTFILE "-- tgc_i\n";
if ($slave[$i]{"tgc_i"} eq 1) {
if ($slave[$i]{"tgc_i"} == 1) {
$tmp=0;
for ($j=1; $j le $masters; $j++) {
if ($master[$j]{("priority_".($slave[$i]{"wbs"}))} ne 0) {
for ($j=1; $j <= $masters; $j++) {
if ($master[$j]{("priority_".($slave[$i]{"wbs"}))} != 0) {
$tmp+=1;
};
};
if ($tmp eq 1) {
$tmp=1; until ($master[$tmp]{("priority_".($slave[$i]{"wbs"}))} ne 0) {$tmp++;};
if ($tmp == 1) {
$tmp=1; until ($master[$tmp]{("priority_".($slave[$i]{"wbs"}))} != 0) {$tmp++;};
printf OUTFILE "%s_%s_i <= %s_%s_o",$slave[$i]{"wbs"},$rename_tgc,$master[$tmp]{"wbm"},$rename_tgc;
} else {
$tmp=1; until ($master[$tmp]{("priority_".($slave[$i]{"wbs"}))} ne 0) {$tmp++;};
$tmp=1; until ($master[$tmp]{("priority_".($slave[$i]{"wbs"}))} != 0) {$tmp++;};
printf OUTFILE "%s_%s_i <= (%s_%s_o and %s_%s_bg)",$slave[$i]{"wbs"},$rename_tgc,$master[$tmp]{"wbm"},$rename_tgc,$master[$tmp]{"wbm"},$slave[$i]{"wbs"};
for ($j=$tmp+1; $j le $masters; $j++) {
if ($master[$j]{("priority_".($slave[$i]{"wbs"}))} ne 0) {
if ($master[$j]{"tga_o"} eq 1) {
for ($j=$tmp+1; $j <= $masters; $j++) {
if ($master[$j]{("priority_".($slave[$i]{"wbs"}))} != 0) {
if ($master[$j]{"tga_o"} == 1) {
printf OUTFILE " or (%s_%s_o and %s_%s_bg)",$master[$j]{"wbm"},$rename_tgc,$master[$j]{"wbm"},$slave[$i]{"wbs"};
} else {
if ($classic ne "000") {
@@ -1919,23 +1919,23 @@
}; # tga
printf OUTFILE "-- tga_i\n";
if ($slave[$i]{"tga_i"} eq 1) {
if ($slave[$i]{"tga_i"} == 1) {
$tmp=0;
for ($j=1; $j le $masters; $j++) {
if ($master[$j]{("priority_".($slave[$i]{"wbs"}))} ne 0) {
for ($j=1; $j <= $masters; $j++) {
if ($master[$j]{("priority_".($slave[$i]{"wbs"}))} != 0) {
$tmp+=1;
};
};
if ($tmp eq 1) {
$tmp=1; until ($master[$tmp]{("priority_".($slave[$i]{"wbs"}))} ne 0) {$tmp++;};
if ($tmp == 1) {
$tmp=1; until ($master[$tmp]{("priority_".($slave[$i]{"wbs"}))} != 0) {$tmp++;};
printf OUTFILE "%s_%s_i <= %s_%s_o",$slave[$i]{"wbs"},$rename_tga,$master[$tmp]{"wbm"},$rename_tga;
} else {
$tmp=1; until ($master[$tmp]{("priority_".($slave[$i]{"wbs"}))} ne 0) {$tmp++;};
$tmp=1; until ($master[$tmp]{("priority_".($slave[$i]{"wbs"}))} != 0) {$tmp++;};
printf OUTFILE "%s_%s_i <= (%s_%s_o and %s_%s_bg)",$slave[$i]{"wbs"},$rename_tga,$master[$tmp]{"wbm"},$rename_tga,$master[$tmp]{"wbm"},$slave[$i]{"wbs"};
for ($j=$tmp+1; $j le $masters; $j++) {
if ($master[$j]{("priority_".($slave[$i]{"wbs"}))} ne 0) {
if ($master[$j]{"tga_o"} eq 1) {
for ($j=$tmp+1; $j <= $masters; $j++) {
if ($master[$j]{("priority_".($slave[$i]{"wbs"}))} != 0) {
if ($master[$j]{"tga_o"} == 1) {
printf OUTFILE " or (%s_%s_o and %s_%s_bg)",$master[$j]{"wbm"},$rename_tga,$master[$j]{"wbm"},$slave[$i]{"wbs"};
};
};
@@ -1947,13 +1947,13 @@
}; sub gen_remap{ if ($master[$i]{"err_i"} eq 1) {
if ($master[$i]{"err_i"} == 1) {
printf OUTFILE "%s_wbm_i.err_i <= %s_err_i;\n",$master[$i]{"wbm"},$master[$i]{"wbm"}; };
if ($master[$i]{"rty_i"} eq 1) {
if ($master[$i]{"rty_i"} == 1) {
printf OUTFILE "%s_wbm_i.rty_i <= %s_rty_i;\n",$master[$i]{"wbm"},$master[$i]{"wbm"}; };
if ($master[$i]{"type"} ne "ro") {
printf OUTFILE "%s_dat_o <= %s_wbm_o.dat_o;\n",$master[$i]{"wbm"},$master[$i]{"wbm"};
@@ -1961,20 +1961,20 @@
};
printf OUTFILE "%s_sel_o <= %s_wbm_o.sel_o;\n",$master$i{"wbm"},$master$i{"wbm"};
printf OUTFILE "%s_adr_o <= %s_wbm_o.adr_o;\n",$master$i{"wbm"},$master$i{"wbm"}; if ($master[$i]{"tgc_o"} eq 1) {
if ($master[$i]{"tgc_o"} == 1) {
printf OUTFILE "%s_%s_o <= %s_wbm_o.%s_o;\n",$master[$i]{"wbm"},$rename_tgc,$master[$i]{"wbm"},$rename_tgc; };
if ($master[$i]{"tga_o"} eq 1) {
if ($master[$i]{"tga_o"} == 1) {
printf OUTFILE "%s_%s_o <= %s_wbm_o.%s_o;\n",$master[$i]{"wbm"},$rename_tga,$master[$i]{"wbm"},$rename_tga; };
printf OUTFILE "%s_cyc_o <= %s_wbm_o.cyc_o;\n",$master[$i]{"wbm"},$master[$i]{"wbm"};
printf OUTFILE "%s_stb_o <= %s_wbm_o.stb_o;\n",$master[$i]{"wbm"},$master[$i]{"wbm"};
}; if ($slave[$i]{"err_o"} eq 1) {
if ($slave[$i]{"err_o"} == 1) {
printf OUTFILE "%s_err_o <= %s_wbs_o.err_o;\n",$slave[$i]{"wbs"},$slave[$i]{"wbs"}; };
if ($slave[$i]{"rty_o"} eq 1) {
if ($slave[$i]{"rty_o"} == 1) {
printf OUTFILE "%s_rty_o <= %s_wbs_o.rty_o;\n",$slave[$i]{"wbs"},$slave[$i]{"wbs"}; };
if ($slave[$i]{"type"} ne "ro") {
printf OUTFILE "%s_wbs_i.dat_i <= %s_dat_i;\n",$slave[$i]{"wbs"},$slave[$i]{"wbs"};
@@ -1982,9 +1982,9 @@
};
printf OUTFILE "%s_wbs_i.sel_i <= %s_sel_i;\n",$slave$i{"wbs"},$slave$i{"wbs"};
printf OUTFILE "%s_wbs_i.adr_i <= %s_adr_i;\n",$slave$i{"wbs"},$slave$i{"wbs"}; if ($slave[$i]{"tgc_i"} eq 1) {
if ($slave[$i]{"tgc_i"} == 1) {
printf OUTFILE "%s_wbs_i.%s_i <= %s_%s_i;\n",$slave[$i]{"wbs"},$rename_tgc,$slave[$i]{"wbs"},$rename_tgc; };
if ($slave[$i]{"tga_i"} eq 1) {
if ($slave[$i]{"tga_i"} == 1) {
printf OUTFILE "%s_wbs_i.%s_i <= %s_%s_i;\n",$slave[$i]{"wbs"},$rename_tga,$slave[$i]{"wbs"},$rename_tga; };
printf OUTFILE "%s_wbs_i.cyc_i <= %s_cyc_i;\n",$slave[$i]{"wbs"},$slave[$i]{"wbs"};
printf OUTFILE "%s_wbs_i.stb_i <= %s_stb_i;\n",$slave[$i]{"wbs"},$slave[$i]{"wbs"};