Menu

Feature noisy=0 desired in res.sym

2025-06-06
2025-06-09
  • Patrick Fath

    Patrick Fath - 2025-06-06

    As in ngspice it's possible to manually turn off/on resistor noise, could a switch be added to res.sym, so that after creating the netlist it's created like R1 v1 v2 50 m=1 noisy=0?

     
  • Patrick Fath

    Patrick Fath - 2025-06-08

    Thanks! The problem is, it will not work in Xyce as noisy=0 is a ngspice command, so as a result, res.sym will not work anymore if using Xyce. Maybe there is a better solution than just replacing the symbol?

     

    Last edit: Patrick Fath 2025-06-08
  • stefan

    stefan - 2025-06-09

    you can add these attributes to the resistor instances:

    name=R1
    value=1k
    noisy=1
    m=1
    format="tcleval([
      if {[sim_is_ngspice]} {
        return {@name @pinlist @value noisy=@noisy m=@m }
      } else {
        return {@name @pinlist @value m=@m }
      }
    ])"
    
     
  • stefan

    stefan - 2025-06-09

    I think you can create a res_noisy.sym symbol and add the format attribute above in the symbol.
    symbols in the devices/ directory are generic and not bound to specific simulators so I prefer not to change res.sym.

     
  • stefan

    stefan - 2025-06-09

    Latest xschem commit adds res_noisy.sym that adds the noisy=1 or noisy=0 attribute if target simulator is set to ngspice.

     
  • Patrick Fath

    Patrick Fath - 2025-06-09

    Yes works great, really thanks for the contribution!

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.