Hi, I am kind of confused as to how I can add port...
# ieee-sscs-dc-24
k
Hi, I am kind of confused as to how I can add ports to a newly created component. I tried printing it's existing port list using Component.ports but it's empty....ik that the Component.add_ports method exists but how do I format my list of port names and ports of devices inside it ? Like there are two nmos-es whose gates I wanna use an inputs to this component. I tried creating a dictionary where the string was the name I wanna call these ports by like "VinP" and "VinN" and the second element was the actual port like nfetLref.ports["multiplier_0_gate_S"] but I get an error saying that this port already exists in a constituent device which it does...... Can anyone please help point me in the right direction?
1
@mehdi @Sakib Pathen could somebody please help me with this? how to properly rename the ports ? as this would let us use smaller or kinda reptitive blocks in bigger designs. Like rn, I am trying to make a differential ring oscillator layout and knowing how to rename ports for one stage would help me, just call the function three times and route the appropriate ports between the three stages for example. If this has been covered in a meeting (to rename ports and use that circuit block in a bigger design) I would like to apologise, if you could point me to the meeting date I will just go and watch the recording.
1
c
The way we do this in the repo is that when youre adding a constituent component's port to the top level, you add an easily identifiable prefix using the prefix arg in the
add_ports
function
This will copy over the ports from the constituent component after adding the prefix you asked for
k
@Chetanya Goyal could you give an example of how to use the
add_ports
function? I am not really proficient at coding. Seeing an example would help me better understand how to use it
c
say
toplvl
is your top level component and youre trying to add `nfetL`'s ports to
toplvl
Copy code
toplvl.add_ports(nfetL.get_ports_list(), prefix = 'left_fet_')