Origen-SDK / origen

The Origen Semiconductor Developer's Kit core platform
http://origen-sdk.org
MIT License
20 stars 24 forks source link

Pin package level coordinate data #298

Open info-rchitect opened 6 years ago

info-rchitect commented 6 years ago

All,

When re-writing our pin importer, I realized there is a lot of package coordinate metadata that really has no way to be added to the model.

  {:x=>11000,
   :y=>-14800,
   :pcbpad=>"pad500",
   :pcbxy=>"[11000,-14800]",
   :rvia=>"[[-121000,-115200],[500,400]]",
   :rtrace=>"[[[500,400,100]]]",
   :location=>"BA36"},

The current package scoped attributes list is:

[:location, :dib_assignment, :dib_meta]

Should we add a :pkg_meta attribute similar to the existing functionally scoped :meta attribute?

ginty commented 6 years ago

It does seem like a good idea, however should it not just be :meta ?

Currently it looks like you can supply :meta when defining the pin, and then again when defining functions and Origen will merge them into a single my_pin.meta attribute depending on what function is enabled.

So I would then expect for the package that I could do:

add_pin :tdi, packages: { bga: { meta: { blah: :blah } } } 

And the package specific meta data would get merged into my_pin.meta in the same way for the current package.

info-rchitect commented 6 years ago

@ginty I didn't know it did the merge. Should this be possible?

add_pin :tdi, meta: { die_level_attr: die_level_val }, packages: { bga: { meta: { blah: :blah } } } 
ginty commented 6 years ago

Yes, that's how I would expect it to work, this should be the spec test:

dut.add_pin :tdi, meta: { die_level_attr: :die_level_val }, packages: { bga: { meta: { blah: :blah } } }

dut.package = nil

dut.pin(:tdi).meta.should == { die_level_attr: :die_level_val }

dut.package = :bga

dut.pin(:tdi).meta.should == { die_level_attr: :die_level_val, blah: :blah }
info-rchitect commented 6 years ago

@ginty I was not able to get the following to work:

dut.add_pin :tdi, packages: { bga: { meta: { blah: :blah } } }

The metadata was always an empty hash even when I set the package. I was able to assign the meta at the die level scope. Here is what i see in the debugger for the package specific hash I pass as a add_pin arg:

=> {:packages=>
  {:pcs=>
    {:meta=>
      {:macrotype=>"NA",
       :macroinst=>"NA",
       :macroport=>"NA",
       :padsite=>"NA",
       :rdl=>"NA",
       :bump=>"NA",
       :substrate=>"VDD",
       :ball=>"VDD_SENSE",
       :model_in_origen_as=>:virtual,
       :packages=>[:pcs, :pkg1],
       :location=>"BC20",
       :ballmap_group=>"POWER",
       :x=>-5000,
       :y=>-16400,
       :pcbpad=>"pad500",
       :pcbxy=>"[-5000,-16400]",
       :rvia=>"[[500,400]]",
       :rtrace=>"[[[500,400,100]]]"}},
   :bl5=>
    {:meta=>
      {:macrotype=>"NA",
       :macroinst=>"NA",
       :macroport=>"NA",
       :padsite=>"NA",
       :rdl=>"NA",
       :bump=>"NA",
       :substrate=>"VDD",
       :ball=>"VDD_SENSE",
       :model_in_origen_as=>:virtual,
       :packages=>[:pcs, :pkg1],
       :location=>"BC20",
       :ballmap_group=>"POWER",
       :x=>-5000,
       :y=>-16400,
       :pcbpad=>"pad500",
       :pcbxy=>"[-5000,-16400]",
       :rvia=>"[[500,400]]",
       :rtrace=>"[[[500,400,100]]]"}}}}
ginty commented 6 years ago

@info-rchitect, yes it doesn't work yet, I'm saying that this is the way it should work if we add something here.

It does work that way already for functions, so this is the way we should make it work for packages also - i.e. rather than adding a :pkg_meta attribute which was the original proposal.

info-rchitect commented 6 years ago

@ginty OK gotcha, I will make a PR once I get the importer done.