1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
function [bonds,components] = rbg2abg(name,rbonds,rstrokes,rcomponents,\
port_coord,port_name,\
infofile,errorfile)
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% $Id$
% %% $Log$
% %% Revision 1.37 1998/07/28 19:06:43 peterg
% %% Still some bugs (vector SS ports)??
% %%
% %% Revision 1.36 1998/07/28 10:30:50 peterg
% %% Implemented vector SS ports.
% %%
% %% Revision 1.35 1998/07/08 15:35:15 peterg
|
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
function [bonds,components] = rbg2abg(name,rbonds,rstrokes,rcomponents,\
port_coord,port_name,\
infofile,errorfile)
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% $Id$
% %% $Log$
% %% Revision 1.38 1999/03/12 00:58:06 peterg
% %% Now gets portlist from the _abg.m file NOT the _rbg.m file
% %% - this allows expansion of vector SS ports.
% %%
% %% Revision 1.37 1998/07/28 19:06:43 peterg
% %% Still some bugs (vector SS ports)??
% %%
% %% Revision 1.36 1998/07/28 10:30:50 peterg
% %% Implemented vector SS ports.
% %%
% %% Revision 1.35 1998/07/08 15:35:15 peterg
|
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
|
# % Recompute the number of unsorted ports
# [n_unsorted_ports,m_unsorted_ports] = size(unsorted_port_list);
# if m_unsorted_ports==0
# n_unsorted_ports = 0;
# end;
% Junctions or no lables(order of ports unimportant)
if strcmp(comp_type,'zero')|strcmp(comp_type,'one')
for j = 1:n_comp_bonds
components(i,j) = signed_bond_list(j);
end
else %Order of ports is important
unsorted_port_list, port_list
if n_unsorted_ports==0
mtt_error(['Component ', comp_name, ' (', comp_type, ') has no labeled ports'], errorfile);
end;
%Write out the signed bond list in the correct order
unsorted_port_list
for j = 1:n_comp_bonds
j
name_k = unsorted_port_list(j,:)
k = name_in_list(name_k, port_list);
% Check that it only appears once in port list
if length(k)>1
mtt_error(['Component ', comp_name, ' (', comp_type, ') has ports with the same name: ', name_k], errorfile);
|
|
>
>
>
>
>
>
|
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
|
# % Recompute the number of unsorted ports
# [n_unsorted_ports,m_unsorted_ports] = size(unsorted_port_list);
# if m_unsorted_ports==0
# n_unsorted_ports = 0;
# end;
% Junctions (order of ports unimportant)
if strcmp(comp_type,'zero')|strcmp(comp_type,'one')
for j = 1:n_comp_bonds
components(i,j) = signed_bond_list(j);
end
else %Order of ports is important
unsorted_port_list, port_list
if n_unsorted_ports==0
mtt_error(['Component ', comp_name, ' (', comp_type, ') has no labeled ports'], errorfile);
end;
%Write out the signed bond list in the correct order
unsorted_port_list
[n_list,m_list] = size(unsorted_port_list);
if n_list!=n_comp_bonds
error(sprintf("Component %s (%s) has %i bonds but %i port lables",\
comp_name, comp_type, n_comp_bonds, n_list))
endif
for j = 1:n_comp_bonds
j
name_k = unsorted_port_list(j,:)
k = name_in_list(name_k, port_list);
% Check that it only appears once in port list
if length(k)>1
mtt_error(['Component ', comp_name, ' (', comp_type, ') has ports with the same name: ', name_k], errorfile);
|