firmware_tools/logic_memory_mapper/gen_depend.py

58 lines
2 KiB
Python

# -----------------------------------------------------------------------------
# Title : JSON make file dependency generator
# Project : Generic FW tools
# -----------------------------------------------------------------------------
# File : gen_depend.py
# Author : Simon Southwell
# Company : Global Inkjet Systems
# Created : 2020-07-23
# Last update: 2020-07-23
# Platform :
# Standard : Python 3.x
# -----------------------------------------------------------------------------
# Description:
# Definition of class to read JSON register definitions and generate a make
# dependency include file. Uses MemMapperBase for methods to read JSON files
# and produce a model.
# -----------------------------------------------------------------------------
# Copyright (c) 2020 Global Inkjet Systems
# -----------------------------------------------------------------------------
import os
import sys
import argparse
import time
# Import base class to locate and read JSON files, and present a model
# to derived child class.
from memMapperBase import MemMapperBase, attr, regtype
# --------------------------------------------------------------
# Parse the command line arguments specific to the package
# generator
#
def processCmdLine() :
# Create a parser object
parser = argparse.ArgumentParser(description='Process command line options.')
# Process common command line options with inherited static base class method
MemMapperBase.processCmdLine(parser)
return parser.parse_args()
# ###############################################################
# Only run if not imported
#
if __name__ == '__main__' :
# Process the command line options
cmdArgs = processCmdLine()
memMapDepend = MemMapperBase()
# Run the program for VHDL RTL generation
memMapDepend.run(cmdArgs.topBlock, cmdArgs.busList, cmdArgs.repoDir, cmdArgs.opDir, cmdArgs.opFileSuffix, 'hdl', cmdArgs.jsonFile, cmdArgs.buildDir, cmdArgs.qsysSuffix, cmdArgs.makeList)
del memMapDepend