Skip to content

Instantly share code, notes, and snippets.

@stevedoyle
Created November 22, 2013 16:06
Show Gist options
  • Save stevedoyle/7602330 to your computer and use it in GitHub Desktop.
Save stevedoyle/7602330 to your computer and use it in GitHub Desktop.
Simple utility script to generate a table of PCIe bandwidth for various link width configurations and for raw and 75% efficiency
#!/usr/bin/python
def divider():
print '-'*40
def width_str(width):
return "x%d" % (width)
gens = [1,2,3]
link_widths = [1,2,4,8,16,24,32]
for gen in gens:
divider()
for width in link_widths:
raw = (2**gen)*width
print "Gen %d, %3s: raw: %3d Gbps; 75%s: %3d Gbps" % (gen, width_str(width), raw, '%', raw*0.75)
divider()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment