reimplement buildafi deprecation warning
Implementation that used warn(DeprecationWarning) wasn't printing to output or being logged implement it with more straightforward logging messages and by changing taskname to buildbitstream
This commit is contained in:
parent
d24dbdd6c3
commit
d086ed8a0c
|
@ -23,7 +23,6 @@ from awstools.awstools import awsinit, get_aws_userid
|
||||||
from awstools.afitools import *
|
from awstools.afitools import *
|
||||||
|
|
||||||
from buildtools.buildconfigfile import BuildConfigFile
|
from buildtools.buildconfigfile import BuildConfigFile
|
||||||
from buildtools.buildconfig import BuildConfig
|
|
||||||
|
|
||||||
from util.streamlogger import StreamLogger
|
from util.streamlogger import StreamLogger
|
||||||
|
|
||||||
|
@ -86,7 +85,7 @@ def register_task(task: Callable) -> Callable:
|
||||||
# we don't want this function to be callable any way other than via firesim.main()
|
# we don't want this function to be callable any way other than via firesim.main()
|
||||||
# so that we know programmatic changes to TASKS are followed (currently for testing purposes)
|
# so that we know programmatic changes to TASKS are followed (currently for testing purposes)
|
||||||
# so we don't return the original callable task, we return a lambda that raises
|
# so we don't return the original callable task, we return a lambda that raises
|
||||||
def inner():
|
def inner(*args, **kwargs):
|
||||||
raise FiresimTaskAccessViolation(f"Called '{tn}' without going through TASKS")
|
raise FiresimTaskAccessViolation(f"Called '{tn}' without going through TASKS")
|
||||||
# or actually, we define a closure with def and return that because lambdas that raise
|
# or actually, we define a closure with def and return that because lambdas that raise
|
||||||
# are convoluted
|
# are convoluted
|
||||||
|
@ -147,8 +146,8 @@ def runworkload(runtime_conf: RuntimeConfig) -> None:
|
||||||
|
|
||||||
@register_task
|
@register_task
|
||||||
def buildafi(build_config_file: BuildConfigFile) -> None:
|
def buildafi(build_config_file: BuildConfigFile) -> None:
|
||||||
warn("buildafi is deprecated. buildbitstream is the new name from version=1.14.0", DeprecationWarning, stacklevel=1)
|
# shouldn't ever be able to get here because main() implements logging and redirecting to builtbitstream
|
||||||
buildbitstream(build_config_file)
|
raise NotImplementedError
|
||||||
|
|
||||||
@register_task
|
@register_task
|
||||||
def buildbitstream(build_config_file: BuildConfigFile) -> None:
|
def buildbitstream(build_config_file: BuildConfigFile) -> None:
|
||||||
|
@ -333,6 +332,10 @@ def main(args: argparse.Namespace) -> None:
|
||||||
# different keys. also, probably won't get MITM'd
|
# different keys. also, probably won't get MITM'd
|
||||||
env.disable_known_hosts = True
|
env.disable_known_hosts = True
|
||||||
|
|
||||||
|
if args.task == 'buildafi':
|
||||||
|
rootLogger.warning("From v1.14.0, 'buildafi' is renamed to 'buildbitream' and will be removed in a future version")
|
||||||
|
args.task = 'buildbitstream'
|
||||||
|
|
||||||
rootLogger.info("FireSim Manager. Docs: http://docs.fires.im\nRunning: %s\n", str(args.task))
|
rootLogger.info("FireSim Manager. Docs: http://docs.fires.im\nRunning: %s\n", str(args.task))
|
||||||
|
|
||||||
t = TASKS[args.task]
|
t = TASKS[args.task]
|
||||||
|
@ -364,6 +367,9 @@ if __name__ == '__main__':
|
||||||
randname = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(16))
|
randname = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(16))
|
||||||
return timeline + "-" + args.task + "-" + randname + ".log"
|
return timeline + "-" + args.task + "-" + randname + ".log"
|
||||||
|
|
||||||
|
# treat python warnings as WARNING level messages from py.warn
|
||||||
|
logging.captureWarnings(True)
|
||||||
|
|
||||||
rootLogger = logging.getLogger()
|
rootLogger = logging.getLogger()
|
||||||
rootLogger.setLevel(logging.NOTSET) # capture everything
|
rootLogger.setLevel(logging.NOTSET) # capture everything
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ end up with something like this (a line beginning with a ``#`` is a comment):
|
||||||
|
|
||||||
[builds]
|
[builds]
|
||||||
# this section references builds defined in config_build_recipes.ini
|
# this section references builds defined in config_build_recipes.ini
|
||||||
# if you add a build here, it will be built when you run buildafi
|
# if you add a build here, it will be built when you run buildbitstream
|
||||||
firesim-rocket-quadcore-no-nic-l2-llc4mb-ddr3
|
firesim-rocket-quadcore-no-nic-l2-llc4mb-ddr3
|
||||||
|
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ Now, we can run a build like so:
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
firesim buildafi
|
firesim buildbitstream
|
||||||
|
|
||||||
This will run through the entire build process, taking the Chisel RTL
|
This will run through the entire build process, taking the Chisel RTL
|
||||||
and producing an AFI/AGFI that runs on the FPGA. This whole process will
|
and producing an AFI/AGFI that runs on the FPGA. This whole process will
|
||||||
|
|
|
@ -6,6 +6,6 @@ set -o pipefail
|
||||||
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
||||||
source $SCRIPT_DIR/defaults.sh
|
source $SCRIPT_DIR/defaults.sh
|
||||||
|
|
||||||
run "cd firesim/ && source sourceme-f1-manager.sh && firesim buildafi"
|
run "cd firesim/ && source sourceme-f1-manager.sh && firesim buildbitstream"
|
||||||
|
|
||||||
echo "Success"
|
echo "Success"
|
||||||
|
|
Loading…
Reference in New Issue