klayoutmatthias / tf_import

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

KLayout 0.27: package "tf_import 1.0" dies with error message #7

Open refob opened 3 years ago

refob commented 3 years ago

I installed klayout-0.27-0.x86_64.rpm on CentOS7 and used the Salt Package Manager to install the the package " tf_import 1.0". Then I ran this command:

klayout -rd tf_file=df2/NCSU_Techlib_tsmc02_laydefs.tf -rd lyp_file=out.lyp fifo.gds

Which outputs this error:

ERROR: /home/reinhard/.klayout/salt/tf_import/ruby/import_tf.rb:70: uninitialized constant TechfileToKLayout::StringIO /home/reinhard/.klayout/salt/tf_import/ruby/import_tf.rb:70:in read_skill_file_as_ruby_expr' /home/reinhard/.klayout/salt/tf_import/ruby/import_tf.rb:195:inimport_techfile' /home/reinhard/.klayout/salt/tf_import/macros/import_tf_standalone.rb:35:in <module:TechfileToKLayout>' /home/reinhard/.klayout/salt/tf_import/macros/import_tf_standalone.rb:24:in

' (class NameError)

Executing File>Import Cadence Techfile in the gui showed this error:

ERROR: /home/reinhard/.klayout/salt/tf_import/ruby/import_tf.rb:70: uninitialized constant TechfileToKLayout::StringIO /home/reinhard/.klayout/salt/tf_import/ruby/import_tf.rb:70:in read_skill_file_as_ruby_expr' /home/reinhard/.klayout/salt/tf_import/ruby/import_tf.rb:195:inimport_techfile' /home/reinhard/.klayout/salt/tf_import/macros/import_tf.lym:32:in <module:TechfileToKLayout>' /home/reinhard/.klayout/salt/tf_import/macros/import_tf.lym:17:in

' (class NameError)

ffetsred commented 2 years ago

I have the same error on Windows portable version of KLayout. It looks like ruby requires an explicit "require 'stringio'". Once I add it it works fine for me.

Change needs to be implemented in the following files: salt/tf_import/macros/import_tf.lym salt/tf_import/macros/import_tf_standalone.rb

From:

...
require "import_tf"
...

To:

...
require 'stringio'
require "import_tf"
...
tobidelbruck commented 1 year ago

Thanks! That fixed it for me too. You need to restart (or otherwise reload) this useful tf_import package! Then all I needed was techfile.tf and display.drf, both found in our vendors PDK installation (not in our main chip design cadence folder)