klayoutmatthias / tf_import

Reads a Cadence techfile into KLayout and produces layer properties from it
MIT License
23 stars 5 forks source link

Can't handle multiline 'ref statements in the .tf file #4

Open horror-vacui opened 4 years ago

horror-vacui commented 4 years ago

tf import returns with an error related to the first line below:

            'ref "Vx.S.1_V1, Vx.S.1_V1, VxBAR.S.Vx.2_V1, VxBAR.S.Vx.2_V1, \
            Vx.S.1_V1, Vx.S.1_V1, VxBAR.S.Vx.2_V1, VxBAR.S.Vx.2_V1, \
            VxBAR.S.Vx.2_V1, VxBAR.S.Vx.2_V1, VxBAR.S.2_V1, VxBAR.S.3_V1, \
            VxBAR.S.Vx.2_V1, VxBAR.S.Vx.2_V1, VxBAR.S.3_V1, VxBAR.S.3_V1"

Unfortunately I am not allowed to share the technology file, but I think I can say so much as that the above line is inside a spacingTables() function/object and also inside in a minCutClassSpacing, which is only defined for vias. The error occurs at the first such minCutClassSpacing block.

The error message:

ERROR: (eval):3332: (eval):3332: syntax error, unexpected tCONSTANT, expecting ']'
            "VxBAR.S.Vx.2_V1,",  "VxBAR.S.Vx.2_...
             ^~~~~
(eval):3332: no .<digit> floating literal anymore; put 0 before dot
            "VxBAR.S.Vx.2_V1,",  "VxBAR.S.Vx.2_V1,", ...
                       ^
(eval):3332: trailing `_' in number
            "VxBAR.S.Vx.2_V1,",  "VxBAR.S.Vx.2_V1,",  "...
                         ^
(eval):3332: syntax error, unexpected tINTEGER, expecting '('
            "VxBAR.S.Vx.2_V1,",  "VxBAR.S.Vx.2_V1,",  "...
                          ^
  /home/zoltan/.klayout/salt/tf_import/ruby/import_tf.rb:195:in `eval'
  /home/zoltan/.klayout/salt/tf_import/ruby/import_tf.rb:195:in `import_techfile'
  /home/zoltan/.klayout/salt/tf_import/macros/import_tf.lym:32:in `<module:TechfileToKLayout>'
  /home/zoltan/.klayout/salt/tf_import/macros/import_tf.lym:17:in `<main>' (class SyntaxError)

After I've removed the '\' characters and joined the lines together, the techfile was read in, and the layer names & purposes have been recognized.

I've used KLayout 0.26.5 with tf_import 1.0.