diff options
author | Dam Sunwoo <dam.sunwoo@arm.com> | 2012-01-31 07:46:04 -0800 |
---|---|---|
committer | Dam Sunwoo <dam.sunwoo@arm.com> | 2012-01-31 07:46:04 -0800 |
commit | 0ed3c84c7b05d7d3c9d5f0e3f1c05c20afef93b9 (patch) | |
tree | 9663b1af4da7ee4c063fa0047da7cbf7e8a2b9de /src/arch/arm/isa/insts | |
parent | af6aaf258171027af8d3cf0ef86dddff501a3ccb (diff) | |
download | gem5-0ed3c84c7b05d7d3c9d5f0e3f1c05c20afef93b9.tar.xz |
util: implements "writefile" gem5 op to export file from guest to host filesystem
Usage: m5 writefile <filename>
File will be created in the gem5 output folder with the identical filename.
Implementation is largely based on the existing "readfile" functionality.
Currently does not support exporting of folders.
Diffstat (limited to 'src/arch/arm/isa/insts')
-rw-r--r-- | src/arch/arm/isa/insts/m5ops.isa | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/arch/arm/isa/insts/m5ops.isa b/src/arch/arm/isa/insts/m5ops.isa index 222ecc647..1a154459e 100644 --- a/src/arch/arm/isa/insts/m5ops.isa +++ b/src/arch/arm/isa/insts/m5ops.isa @@ -265,6 +265,24 @@ let {{ decoder_output += BasicConstructor.subst(m5readfileIop) exec_output += PredOpExecute.subst(m5readfileIop) + m5writefileCode = ''' +#if FULL_SYSTEM + int n = 4; + uint64_t offset = getArgument(xc->tcBase(), n, sizeof(uint64_t), false); + n = 6; + Addr filenameAddr = getArgument(xc->tcBase(), n, sizeof(Addr), false); + R0 = PseudoInst::writefile(xc->tcBase(), R0, join32to64(R3,R2), offset, + filenameAddr); +#endif + ''' + m5writefileIop = InstObjParams("m5writefile", "M5writefile", "PredOp", + { "code": m5writefileCode, + "predicate_test": predicateTest }, + ["IsNonSpeculative"]) + header_output += BasicDeclare.subst(m5writefileIop) + decoder_output += BasicConstructor.subst(m5writefileIop) + exec_output += PredOpExecute.subst(m5writefileIop) + m5breakIop = InstObjParams("m5break", "M5break", "PredOp", { "code": "PseudoInst::debugbreak(xc->tcBase());", "predicate_test": predicateTest }, |