On Fri, Jun 28, 2013 at 10:31 PM, Olof Kindgren <[email protected]> wrote:
> Two small patches in one to make or1200-monitor more useful outside of
> orpsocv2:
>
> - Setting log path with a parameter allows more flexible directory layout
> - By setting TEST_NAME_STRING with a parameter we can get rid of `include
> test-defines in or1200_monitor.v
>
> Index: verilog/or1200_monitor.v
> ===================================================================
> --- verilog/or1200_monitor.v    (revision 860)
> +++ verilog/or1200_monitor.v    (working copy)
> @@ -38,11 +38,13 @@
>  `include "timescale.v"
>  `include "or1200_defines.v"
>  `include "or1200_monitor_defines.v"
> -`include "test-defines.v"
>
>
>  module or1200_monitor;
>
> +   parameter TEST_NAME_STRING = "unnamed";
> +   parameter LOG_DIR          = ".";
> +
>     integer fexe;
>     integer finsn;
>
> @@ -64,18 +66,18 @@
>     initial begin
>        ref = 0;
>  `ifdef OR1200_MONITOR_EXEC_STATE
> -      fexe = $fopen({"../out/",`TEST_NAME_STRING,"-executed.log"});
> +      fexe = $fopen({LOG_DIR, "/", TEST_NAME_STRING,"-executed.log"});
>  `endif
>  `ifdef OR1200_MONITOR_EXEC_LOG_DISASSEMBLY
>        finsn = fexe;
>  `endif
>        $timeformat (-9, 2, " ns", 12);
>  `ifdef OR1200_MONITOR_SPRS
> -      fspr = $fopen({"../out/",`TEST_NAME_STRING,"-sprs.log"});
> +      fspr = $fopen({LOG_DIR, "/", TEST_NAME_STRING,"-sprs.log"});
>  `endif
> -      fgeneral = $fopen({"../out/",`TEST_NAME_STRING,"-general.log"});
> +      fgeneral = $fopen({LOG_DIR, "/", TEST_NAME_STRING,"-general.log"});
>  `ifdef OR1200_MONITOR_LOOKUP
> -      flookup = $fopen({"../out/",`TEST_NAME_STRING,"-lookup.log"});
> +      flookup = $fopen({LOG_DIR, "/", TEST_NAME_STRING,"-lookup.log"});
>  `endif
>        insns = 0;
>
> Index: verilog/orpsoc_testbench.v
> ===================================================================
> --- verilog/orpsoc_testbench.v    (revision 859)
> +++ verilog/orpsoc_testbench.v    (working copy)
> @@ -91,7 +91,10 @@
>     //
>     // Instantiate OR1200 monitor
>     //
> -   or1200_monitor monitor();
> +   or1200_monitor
> +     #(.TEST_NAME_STRING (`TEST_NAME_STRING),
> +       .LOG_DIR("../out"))
> +   monitor();
>
>  `ifndef SIM_QUIET
>   `define CPU_ic_top or1200_ic_top
>
> //Olof
>

Hey Olof

Yeah, that looks good. But what about plusargs? Is that more useful?
Might be nice to have the single simulation executable and just vary
plusargs to set up things like this? Just a thought, I don't mind
either way.

Cheers

Julius
_______________________________________________
OpenRISC mailing list
[email protected]
http://lists.openrisc.net/listinfo/openrisc

Reply via email to