1
0
mirror of https://github.com/antonblanchard/microwatt.git synced 2026-04-25 20:11:34 +00:00
Files
antonblanchard.microwatt/litesdcard/fusesoc-add-files.py
Anton Blanchard 9caaa3fc46 litesdcard: Use vendor not board type
litesdcard provides a macro per vendor (eg xilinx, lattice) and not per
board, so modify the fusesoc generator to take a vendor. This will make
it easier to add litesdcard to more boards.

Signed-off-by: Anton Blanchard <anton@linux.ibm.com>
2021-08-10 14:08:22 +10:00

28 lines
663 B
Python

#!/usr/bin/python3
from fusesoc.capi2.generator import Generator
import os
import sys
import pathlib
class LiteSDCardGenerator(Generator):
def run(self):
vendor = self.config.get('vendor')
# Collect a bunch of directory path
script_dir = os.path.dirname(sys.argv[0])
gen_dir = os.path.join(script_dir, "generated", vendor)
print("Adding LiteSDCard for vendor... ", vendor)
# Add files to fusesoc
files = []
f = os.path.join(gen_dir, "litesdcard_core.v")
files.append({f : {'file_type' : 'verilogSource'}})
self.add_files(files)
g = LiteSDCardGenerator()
g.run()
g.write()