Skip to content

Commit

Permalink
gen fanout with py netlist
Browse files Browse the repository at this point in the history
  • Loading branch information
nanocoh committed Nov 15, 2024
1 parent c5172cd commit 81dac6e
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions designs/arm_core/gen_fanout_list_with_class.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import logging
from naja import snl
import codecs
import faulthandler
from xilinx import constructPrimitives
import netlist

def edit():
faulthandler.enable()
# Load primitives and design
desingFiles = ["./arm_core_snl.v"]
loader = netlist.Loader()
loader.init()
constructPrimitives(loader.getPrimitivesLibrary())
loader.loadVerilog(desingFiles)
loader.verify()

# Collect and dump all driver fanouts
fanout_file = open('fanoutNaja.list','w')
primitives = netlist.getAllPrimitivesInstances()
for entry in primitives:
getInstTerms = entry.getInstTerms()
for term in getInstTerms:
if term.isOutput():
equi = term.getEuiqpotential()
primitiveCount = 0
for equiTerm in equi.getInstTerms():
if equiTerm.getInstance().isPrimitive() and equiTerm.isOutput() == False:
primitiveCount = primitiveCount + 1
fanout_file.write(equiTerm.getString() + " " + str(primitiveCount))
fanout_file.write("\n")

edit()

0 comments on commit 81dac6e

Please sign in to comment.