1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[11987],{28453:(e,t,n)=>{n.d(t,{R:()=>a,x:()=>d});var r=n(96540);const o={},s=r.createContext(o);function a(e){const t=r.useContext(s);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function d(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:a(e.components),r.createElement(s.Provider,{value:t},e.children)}},53151:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>d,default:()=>m,frontMatter:()=>a,metadata:()=>r,toc:()=>i});const r=JSON.parse('{"id":"config/portmodule/addParam","title":"addParam","description":"Adds a parameter to the Params object for the PortModule.","source":"@site/../docs/config/portmodule/addParam.md","sourceDirName":"config/portmodule","slug":"/config/portmodule/addParam","permalink":"/sst-docs/docs/config/portmodule/addParam","draft":false,"unlisted":false,"editUrl":"https://github.com/sstsimulator/sst-docs/edit/master/docs/../docs/config/portmodule/addParam.md","tags":[],"version":"current","lastUpdatedBy":"grvosku","lastUpdatedAt":1762293106000,"frontMatter":{"title":"addParam"},"sidebar":"config","previous":{"title":"PortModules","permalink":"/sst-docs/docs/config/portmodule/overview"},"next":{"title":"addParams","permalink":"/sst-docs/docs/config/portmodule/addParams"}}');var o=n(74848),s=n(28453);const a={title:"addParam"},d=void 0,l={},i=[{value:"Syntax",id:"syntax",level:2},{value:"Parameters",id:"parameters",level:2},{value:"Example",id:"example",level:2},{value:"Import",id:"import",level:2}];function c(e){const t={code:"code",h2:"h2",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.p,{children:"Adds a parameter to the Params object for the PortModule."}),"\n",(0,o.jsx)(t.h2,{id:"syntax",children:"Syntax"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-python",children:"portmodule.addParam(key, value)\n"})}),"\n",(0,o.jsx)(t.h2,{id:"parameters",children:"Parameters"}),"\n",(0,o.jsxs)(t.ul,{children:["\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.strong,{children:"key"})," (type: string) name of the parameter"]}),"\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.strong,{children:"value"})," (type: varies) value of the parameter. This can be almost any Python object and the ",(0,o.jsx)(t.code,{children:"__str__"})," method will be called to get a string representation. A list can be passed to this call when the ",(0,o.jsx)(t.code,{children:"find_array"})," function is used in the class to retrieve the parameters."]}),"\n",(0,o.jsxs)(t.li,{children:[(0,o.jsx)(t.strong,{children:"returns"})," none"]}),"\n"]}),"\n",(0,o.jsx)(t.h2,{id:"example",children:"Example"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-python",children:'import sst\n\ncomponent = sst.Component( ... )\nportmodule = component.addPortModule("port0", "sst.portmodules.random_drop" )\n\n#highlight-next-line\nportmodule.addParam( "drop_prob", 0.1 )\n'})}),"\n",(0,o.jsx)(t.h2,{id:"import",children:"Import"}),"\n",(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-python",children:"import sst\n"})})]})}function m(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(c,{...e})}):c(e)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.