Bug#698760: magic: Excess newlines in distribution .tech files break their parseability

2013-01-23 Thread Ильяс Гасанов
Hello, and thank you for responding.

В Срд, 23/01/2013 в 18:07 +0100, Roland Stigge пишет:
> Hi Ilias,
> 
> On 01/23/2013 11:47 AM, Ильяс Гасанов wrote:
> > Package: magic
> > Version: 7.5.229-1
> > Severity: important
> > 
> > Dear Maintainer,
> > 
> > I have detected an errant behavior at magic loadtime when process
> > technology files are being parsed. Particularly, there are error
> > messages about DRC rule syntax violations, for example:
> > 
> > /usr/lib/x86_64-linux-gnu/magic/sys/scmos.tech: line 4493:
> > section drc:
> > Rule type "edge4way" usage: edge4way layers1 layers2
> > distance okTypes cornerTypes cornerDistance why [plane]
> > /usr/lib/x86_64-linux-gnu/magic/sys/scmos.tech: line 4494:
> > section drc:
> > Bad DRC rule type "N-Well width must be at least 10
> > (MOSIS rule #1.1)"
> > Valid rule types are:
> > angles, edge, edge4way, exact_overlap, extend, no_overlap,
> > overhang, rect_only, spacing, stepsize, surround, width,
> > widespacing, area, maxwidth, cifstyle, cifwidth, cifspacing,
> > cifarea, cifmaxwidth, rectangle.
> > 
> > After that I have observed these files in /usr/lib//magic/sys/ and
> > diagnosed that they have redundant line breaks at logged positions.
> > During the design process many design rule checks are not performed due
> > to this.
> > 
> > This issue has been detected in both Debian testing and experimental
> > package trees. Furthermore, the files listed at magic official site do
> > not have such syntax violations and work just ok:
> > 
> > http://opencircuitdesign.com/magic/tech.html
> > 
> > In the attachment there is a log extracted from wish stderr stream at
> > magic startup.
> 
> Thank you for your report!
> 
> The upstream author already reported back that this is a known issue and
> provided a fix. To test if it really solves the issue completely, I
> would like to check your exact process.
> 
> So can you please describe the complete actions w/ magic to reproduce
> the issue?
> 
> Thanks in advance,
> 
> Roland

I started using magic in my study work only recently, so I can't yet
figure out any specific details about this issue. As I said previously,
the error messages appear at startup, while during the process certain
DRC checks are not applied.

For example, the size of borderspace around NMOS elements within n-well,
as well as minimum distances between polysilicon and diffusion-to-metal
contacts are not checked at all when those .tech files are loaded. What
I did is I tried to reproduce the stuff from a lecture on YouTube, and
also to do some experiments with more complex FET logic using irsim.

Here is the video lecture which I was using in my work:

http://www.youtube.com/watch?v=D32woicgdRk

Sincerely,

Ilyas Gasanov


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#698760: magic: Excess newlines in distribution .tech files break their parseability

2013-01-23 Thread Roland Stigge
Hi Ilias,

On 01/23/2013 11:47 AM, Ильяс Гасанов wrote:
> Package: magic
> Version: 7.5.229-1
> Severity: important
> 
> Dear Maintainer,
> 
> I have detected an errant behavior at magic loadtime when process
> technology files are being parsed. Particularly, there are error
> messages about DRC rule syntax violations, for example:
> 
> /usr/lib/x86_64-linux-gnu/magic/sys/scmos.tech: line 4493:
> section drc:
> Rule type "edge4way" usage: edge4way layers1 layers2
> distance okTypes cornerTypes cornerDistance why [plane]
> /usr/lib/x86_64-linux-gnu/magic/sys/scmos.tech: line 4494:
> section drc:
> Bad DRC rule type "N-Well width must be at least 10
> (MOSIS rule #1.1)"
> Valid rule types are:
> angles, edge, edge4way, exact_overlap, extend, no_overlap,
> overhang, rect_only, spacing, stepsize, surround, width,
> widespacing, area, maxwidth, cifstyle, cifwidth, cifspacing,
> cifarea, cifmaxwidth, rectangle.
> 
> After that I have observed these files in /usr/lib//magic/sys/ and
> diagnosed that they have redundant line breaks at logged positions.
> During the design process many design rule checks are not performed due
> to this.
> 
> This issue has been detected in both Debian testing and experimental
> package trees. Furthermore, the files listed at magic official site do
> not have such syntax violations and work just ok:
> 
> http://opencircuitdesign.com/magic/tech.html
> 
> In the attachment there is a log extracted from wish stderr stream at
> magic startup.

Thank you for your report!

The upstream author already reported back that this is a known issue and
provided a fix. To test if it really solves the issue completely, I
would like to check your exact process.

So can you please describe the complete actions w/ magic to reproduce
the issue?

Thanks in advance,

Roland


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#698760: magic: Excess newlines in distribution .tech files break their parseability

2013-01-23 Thread Tim Edwards

Hello Roland,

   I just noticed that this bug report was concerning magic-7.5.  In
that case, you will probably need the file scmos/Makefile from the
magic-8.0 distribution (attached), because it has the other
corrections that are needed to avoid stripping backslashes in the
techfiles.

   Please let me know what works, and I will correct the distribution
source code.
Regards,
Tim

++-+
| Dr. R. Timothy Edwards (Tim)   | email: t...@opencircuitdesign.com|
| Open Circuit Design, Inc.  | web:   http://opencircuitdesign.com |
| 22815 Timber Creek Lane| phone: (301) 528-5030   |
| Clarksburg, MD 20871-4001  | cell:  (240) 401-0616   |
++-+
###
#
# MOSIS distribution Version 8.2
#
###
#
# The intent in magic version 7.2 was to convert all the "c" style
# files to m4.  However, given the number of files, and the fact that
# they are out of date and should all be replaced anyway, this doesn't
# seem to be worth the effort.  Therefore, some trivial things (like
# minimum.tech) have been converted to m4 and the rest have been left
# alone.
#
###

MAGICDIR = ..

include ${MAGICDIR}/defs.mak

SC_M4 = ${M4}
SC_CPP = ${CPP} -I./extract_template

FILES = mos.7bit.dstyle mos.7bit.std.cmap \
mos.24bit.dstyle mos.24bit.std.cmap \
mos.7bit.mraster_dstyle mos.7bit.mraster.cmap \
mos.OpenGL.dstyle mos.OpenGL.std.cmap
TECHFILES = minimum.tech gdsquery.tech scmos.tech scmos-tm.tech \
scmos-sub.tech scmosWR.tech

CIFin   = cif_template/objs/CIFin
CIFout  = cif_template/objs/CIFout
ICIFin  = cif_template/objs/IBMCIFin
ICIFout = cif_template/objs/IBMCIFout
HCIFin  = cif_template/objs/TMCIFin
HCIFout = cif_template/objs/TMCIFout
SCIFin  = cif_template/objs/SUBCIFin
SCIFout = cif_template/objs/SUBCIFout

OBJS =$(CIFin) $(CIFout) $(HCIFin) $(HCIFout) $(SCIFin) $(SCIFout)

DEPEND = scmos.tech.in \
extract_template/scmosExt.tech.in \
extract_template/scmosExt26b-sub.tech.in \
extract_template/scmosExt060_orb.tech.in \
extract_template/scmosExt080.tech.in \
extract_template/scmosExt100.tech.in \
extract_template/scmosExt34.tech.in \
extract_template/scmosExt14b-sub.tech.in \
extract_template/scmosExtDiag.tech.in \
extract_template/scmosExt14b-tm.tech.in 

all: $(OBJS) $(DEPEND) ${TECHFILES}

install-tcl: all
for i in ${FILES} ${TECHFILES}; do \
${CP} $$i $(DESTDIR)${SYSDIR}; done

install: all
for i in ${FILES} ${TECHFILES}; do \
${CP} $$i $(DESTDIR)${SYSDIR}; done

scmos.tech: $(OBJS)
sed -e 's/\\//' scmos.tech.in > scmos.tech.out
$(SC_CPP) -DV5 -DSTANDARD scmos.tech.out > scmos.tech
$(RM) scmos.tech.out

scmos-tm.tech: $(OBJS)
sed -e 's/\\//' scmos.tech.in > scmos.tech.out
$(SC_CPP) -DV5 -DHPTECH -DTIGHTMETAL scmos.tech.out > scmos-tm.tech
$(RM) scmos.tech.out

scmos-sub.tech: $(OBJS)
sed -e 's/\\//' scmos.tech.in > scmos.tech.out
$(SC_CPP) -DV5 -DSUBMICRON scmos.tech.out > scmos-sub.tech
$(RM) scmos.tech.out

scmosWR.tech: $(OBJS)
sed -e 's/\\//' scmos.tech.in > scmos.tech.out
$(SC_CPP) -DV5 -DSTANDARD -DWELL_ROUTE_CHECK scmos.tech.out > 
scmosWR.tech
$(RM) scmos.tech.out

minimum.tech: minimum.tech.m4
$(SC_M4) minimum.tech.m4 > minimum.tech

gdsquery.tech: gdsquery.tech.m4
$(SC_M4) gdsquery.tech.m4 > gdsquery.tech

$(CIFin):
$(CIFout):
$(ICIFin):
$(ICIFout):
$(HCIFin):
$(HCIFout):
$(SCIFin):
$(SCIFout):
cd cif_template; ${MAKE} clean; ${MAKE};

$(DESTDIR)${SYSDIR}/%: %
cp $* $(DESTDIR)${SYSDIR}/$*

clean:;
-rm -f *.tech *.tech27
cd cif_template && ${MAKE} clean;


Bug#698760: magic: Excess newlines in distribution .tech files break their parseability

2013-01-23 Thread Tim Edwards

Hello Roland,


Looks like the gcc (4.7.2-5 in Debian) preprocessor just discards the "\"
line endings instead of interpreting as line continuations, resulting in
broken resulting files, as reported below.

Is this a known issue?

Please see also http://bugs.debian.org/698760 and please tell how we
can help debugging this.


Yes, this is a known issue.

I corrected it in one place, which is scmos/Makefile.  If you look
at that file, the lines of the type

sed -e 's/\\//' scmos.tech.in > scmos.tech.out

Are meant to add an extra backslash for each backslash in the file,
so that the preprocessor will remove only one of them, and keep the
rest.

This is clearly a bug in the preprocessor, and I was hoping it would
be fixed quickly, but apparently not.

The ideal solution would be to convert all the magic techfile input
files to m4 format, but it was a time-consuming task and I have never
done it.  Barring that, the proper solution would be to have the
configure script detect the preprocessor and handle the cases.  But
it may be okay to put the double-backslash in, as I think magic will
properly handle input with a double backslash if the preprocessor
does not convert it.

After fixing the Makefile in the scmos directory, I was unaware that
the Makefile in scmos/cif_template was also causing problems.

So tentatively, I think a good solution is to add the -e 's/\\//'
line to SED_CMD in cif_template/Makefile.  I think this will solve
the problem.
Regards,
Tim

++-+
| Dr. R. Timothy Edwards (Tim)   | email: t...@opencircuitdesign.com|
| Open Circuit Design, Inc.  | web:   http://opencircuitdesign.com |
| 22815 Timber Creek Lane| phone: (301) 528-5030   |
| Clarksburg, MD 20871-4001  | cell:  (240) 401-0616   |
++-+


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#698760: magic: Excess newlines in distribution .tech files break their parseability

2013-01-23 Thread Roland Stigge
Hi Tim,

at Debian, a certain build issue of magic was found:

Consider building scmos.tech, built like this, according to the log:

[...]
make[4]: Entering directory 
`/build/buildd-magic_7.5.220-1-amd64-6X73cI/magic-7.5.220/scmos/cif_template'
../../scripts/mkdirs objs
mkdir objs
rm -f objs/CIFin
gcc -E -x c -DSTANDARD cifin.c | sed -e "/^#/D" -e "s/(gen )/(gen)/" -e 
"s/(nowell )/(nowell)/" -e "s/(nwell )/(nwell)/" -e "s/(pwell )/(pwell)/" > 
objs/CIFin
rm -f objs/CIFout
gcc -E -x c -DSTANDARD cifout.c | sed -e "/^#/D" -e "s/(gen )/(gen)/" -e 
"s/(nowell )/(nowell)/" -e "s/(nwell )/(nwell)/" -e "s/(pwell )/(pwell)/" > 
objs/CIFout
rm -f objs/IBMCIFin
gcc -E -x c -DIBM cifin.c | sed -e "/^#/D" -e "s/(gen )/(gen)/" -e "s/(nowell 
)/(nowell)/" -e "s/(nwell )/(nwell)/" -e "s/(pwell )/(pwell)/" > objs/IBMCIFin
rm -f objs/IBMCIFout
gcc -E -x c -DIBM cifout.c | sed -e "/^#/D" -e "s/(gen )/(gen)/" -e "s/(nowell 
)/(nowell)/" -e "s/(nwell )/(nwell)/" -e "s/(pwell )/(pwell)/" > objs/IBMCIFout
rm -f objs/TMCIFin
gcc -E -x c -DTIGHTMETAL cifin.c | sed -e "/^#/D" -e "s/(gen )/(gen)/" -e 
"s/(nowell )/(nowell)/" -e "s/(nwell )/(nwell)/" -e "s/(pwell )/(pwell)/" > 
objs/TMCIFin
rm -f objs/TMCIFout
gcc -E -x c -DTIGHTMETAL cifout.c | sed -e "/^#/D" -e "s/(gen )/(gen)/" -e 
"s/(nowell )/(nowell)/" -e "s/(nwell )/(nwell)/" -e "s/(pwell )/(pwell)/" > 
objs/TMCIFout
rm -f objs/SUBCIFin
gcc -E -x c -DSUBMICRON cifin.c | sed -e "/^#/D" -e "s/(gen )/(gen)/" -e 
"s/(nowell )/(nowell)/" -e "s/(nwell )/(nwell)/" -e "s/(pwell )/(pwell)/" > 
objs/SUBCIFin
rm -f objs/SUBCIFout
gcc -E -x c -DSUBMICRON cifout.c | sed -e "/^#/D" -e "s/(gen )/(gen)/" -e 
"s/(nowell )/(nowell)/" -e "s/(nwell )/(nwell)/" -e "s/(pwell )/(pwell)/" > 
objs/SUBCIFout
make[4]: Leaving directory 
`/build/buildd-magic_7.5.220-1-amd64-6X73cI/magic-7.5.220/scmos/cif_template'
/usr/bin/m4 minimum.tech.m4 > minimum.tech
/usr/bin/m4 gdsquery.tech.m4 > gdsquery.tech
gcc -E -x c -I./extract_template -DV5 -DSTANDARD scmos.tech.in > scmos.tech
[...]

Now, looking at source and resulting files:

scmos.tech.in:
=
[...]
/*  */
/*  Well*/
/*  */

/* 1.1 */
/*  Now use "edge" for width DRC... A test only for rule1   */
/*  Other rules may follow in the near future...*/
#ifdef SUBMICRON
edge4way (~nwell)/w nwell 12 nwell nwell 12\
"N-Well width must be at least 12 (MOSIS rule #1.1)"
edge4way (~pwell)/w pwell 12 pwell pwell 12\
"P-Well width must be at least 12 (MOSIS rule #1.1)"
#else
edge4way (~nwell)/w nwell 10 nwell nwell 10\
"N-Well width must be at least 10 (MOSIS rule #1.1)"
edge4way (~pwell)/w pwell 10 pwell pwell 10\
"P-Well width must be at least 10 (MOSIS rule #1.1)"
#endif
[...]
=

scmos.tech:

=
[...]
# 960 "scmos.tech.in"
edge4way (~nwell)/w nwell 10 nwell nwell 10
 "N-Well width must be at least 10 (MOSIS rule #1.1)"
edge4way (~pwell)/w pwell 10 pwell pwell 10
 "P-Well width must be at least 10 (MOSIS rule #1.1)"
[...]
=

Looks like the gcc (4.7.2-5 in Debian) preprocessor just discards the "\"
line endings instead of interpreting as line continuations, resulting in
broken resulting files, as reported below.

Is this a known issue?

Please see also http://bugs.debian.org/698760 and please tell how we
can help debugging this.

Thanks in advance,

Roland



On 01/23/2013 11:47 AM, Ильяс Гасанов wrote:
> Package: magic
> Version: 7.5.229-1
> Severity: important
> 
> Dear Maintainer,
> 
> I have detected an errant behavior at magic loadtime when process
> technology files are being parsed. Particularly, there are error
> messages about DRC rule syntax violations, for example:
> 
> /usr/lib/x86_64-linux-gnu/magic/sys/scmos.tech: line 4493:
> section drc:
> Rule type "edge4way" usage: edge4way layers1 layers2
> distance okTypes cornerTypes cornerDistance why [plane]
> /usr/lib/x86_64-linux-gnu/magic/sys/scmos.tech: line 4494:
> section drc:
> Bad DRC rule type "N-Well width must be at least 10
> (MOSIS rule #1.1)"
> Valid rule types are:
> angles, edge, edge4way, exact_overlap, extend, no_overlap,
> overhang, rect_only, spacing, stepsize, surround, width,
> widespacing, area, maxwidth, cifstyle, cifwidth, cifspacing,
> cifarea, cifmaxwidth, rectangle.
> 
> After that I have observed these files in /usr/lib//magic/sys/ and
> diagnosed that they have redundant line breaks at logged positions.
> During the design process many design ru