Overview
Comment:Now fixes multiports for input and output as well as state
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: e19274ba0fc9e3e146f2cad28626a1a4a6b02ede86c0b7b8441e50bd89f43deb
User & Date: gawthrop@users.sourceforge.net on 2001-07-12 04:02:53
Other Links: branch diff | manifest | tags
Context
2001-07-12
07:29:28
Now handles #PAR (or #VAR) declarations - adds them to the top of the sympar list check-in: 0ec0c085b0 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
04:02:53
Now fixes multiports for input and output as well as state check-in: e19274ba0f user: gawthrop@users.sourceforge.net tags: origin/master, trunk
04:00:51
Now zeros y correctly - ie Ny NOT Nx elements check-in: 6c7a2c10a3 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/abg2tex from [7f9bd54c37] to [f4bd38e131].

10
11
12
13
14
15
16



17
18
19
20
21
22
23
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26







+
+
+







# Copyright (c) P.J.Gawthrop, 1997.

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.2  2000/11/27 17:45:00  peterg
## Removed "System" from  heading
##
## Revision 1.1  2000/11/27 15:11:15  peterg
## Initial revision
##
## Revision 1.7  1997/12/06 16:20:37  peterg
## Added another argument - the label
##
## Revision 1.6  1997/12/06 15:49:35  peterg
41
42
43
44
45
46
47


48
49
50
51
52
53
54
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59







+
+







###############################################################

#Look for a command line argument
while [ -n "`echo $1 | grep '^-'`" ]; do
  case $1 in
	-pdf )  pdf='-pdf'
                ;;
	-s )  sensitivity='-s'
                ;;

	*)
		echo "$1 is an invalid argument - ignoring" ;;
  esac
  shift
done

71
72
73
74
75
76
77
78

79
80
81
82
83
84
85
76
77
78
79
80
81
82

83
84
85
86
87
88
89
90







-
+







%% Subsystem $1
  \subsection{\textbf{$1}}
    \label{sec:$1}
    \index{\textbf{$1} -- abg} 

EOF
else
mtt -q -u $1 abg m # Make sure all the subsystems exist -- nasty kludge
mtt -q -u ${sensitivity} $1 abg m # Make sure all the subsystems exist -- nasty kludge
cat<<EOF > $filename
   % abg report for system $1 ($filename)
   % Generated by MTT at `date`
EOF
fi

# Figure

Modified mttroot/mtt/bin/trans/cbg2ese_m2r from [93dc7c2cf2] to [906b34eb53].

12
13
14
15
16
17
18



19
20
21
22
23
24
25
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28







+
+
+








###############################################################
## Version control history
###############################################################
## $Id$
##
## $Log$
## Revision 1.29  2001/03/29 19:24:14  gawthrop
## Can now use c representations of crs when using -c option
##
## Revision 1.28  2001/02/05 17:19:52  gawthrop
## Now gives unique names to the states of multiports. Second name
## onwards labeled with port number
##
## Revision 1.27  2000/12/05 12:09:56  peterg
## Changed function name to name()
##
326
327
328
329
330
331
332

333
334
335
336
337
338
339
340
341
342
343
344
345
346














347
348
349
350
351
352










353
354
355
356
357
358
359
360
361
362
329
330
331
332
333
334
335
336














337
338
339
340
341
342
343
344
345
346
347
348
349
350
351





352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371







+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+

-
-
-
-
-
+
+
+
+
+
+
+
+
+
+










mv mtt_aliased.txt $1_aliased.txt

# Sort the struc file
mv $structurefile junk
sort -k 1,1 -k 2,2n junk >$structurefile

# Relabel states with multiple ports
relabel_multiple_definitions(){
mv $structurefile junk
awk '
BEGIN{
   state_index=1;  
   oldname="";
}
{
   name=$4;
   newname=name;
   if ($1=="state") {
     if (name==oldname)
       newname = sprintf("%s_%i",name, ++state_index);
     else
       state_index=1;
  mv $structurefile junk
  awk '
  BEGIN{
     var_type_index=1;  
     oldname="";
  }
  {
     name=$4;
     newname=name;
     if ($1==var_type) {
       if (name==oldname)
         newname = sprintf("%s_%i",name, ++var_type_index);
       else
         var_type_index=1; 
   }
   $4 = newname
   for (i=1;i<NF;i++) printf("%s\t",$i);
   printf("%s\n", $NF)
   oldname = name;
'} < junk > $structurefile
     $4 = newname
     for (i=1;i<NF;i++) printf("%s\t",$i);
     printf("%s\n", $NF)
     oldname = name;
  '} < junk var_type=$1> $structurefile
}

relabel_multiple_definitions input;
relabel_multiple_definitions output;
relabel_multiple_definitions state;

# Now invoke the standard error handling.
mtt_error mtt_error.txt








MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]