forked from firesim/FireMarshal
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added firesim install script. not fully tested yet.
- Loading branch information
Nathan Pemberton
committed
Dec 21, 2018
1 parent
6fac494
commit 6dc0021
Showing
6 changed files
with
66 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
python34 | ||
python34-devel | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
psutil | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
""" Install firesim-software stuff into firesim """ | ||
|
||
import json | ||
from pathlib import Path | ||
from .wlutil import * | ||
|
||
# firesim workloads directory | ||
fsWork = (Path(root_dir) / "../../deploy/workloads").resolve() | ||
|
||
readmeTxt="""This workload was generated using firesim-software. See the following config | ||
and workload directory for details: | ||
""" | ||
|
||
def installWorkload(cfgName, cfgs): | ||
targetCfg = cfgs[cfgName] | ||
if 'jobs' in targetCfg: | ||
raise NotImplementedError("Jobs not currently supported by the install command") | ||
if targetCfg['initramfs'] == True: | ||
raise NotImplementedError("Initramfs-based builds not currently supported by the install command") | ||
|
||
fsTargetDir = fsWork / targetCfg['name'] | ||
|
||
# Firesim config | ||
fsCfg = { | ||
"benchmark_name" : targetCfg['name'], | ||
"common_bootbinary" : os.path.relpath(targetCfg['bin'], start=str(fsTargetDir)), | ||
"common_rootfs" : os.path.relpath(targetCfg['img'], start=str(fsTargetDir)), | ||
"common_simulation_outputs" : ["uartlog"], | ||
} | ||
if 'outputs' in targetCfg: | ||
fsCfg["common_outputs"] = targetCfg['outputs'] | ||
if 'post_run_hook' in targetCfg: | ||
fsCfg["post_run_hook"] = os.path.relpath(targetCfg['post_run_hook'], start=str(fsTargetDir)) | ||
|
||
if not fsTargetDir.exists(): | ||
fsTargetDir.mkdir() | ||
|
||
with open(str(fsTargetDir / "README"), 'w') as readme: | ||
readme.write(readmeTxt) | ||
readme.write(os.path.relpath(targetCfg['cfg-file'], start=str(fsTargetDir)) + "\n") | ||
readme.write(os.path.relpath(targetCfg['workdir'], start=str(fsTargetDir)) + "\n") | ||
|
||
with open(str(fsWork / (targetCfg['name'] + '.json')), 'w') as fsCfgFile: | ||
json.dump(fsCfg, fsCfgFile, indent='\t') |