LOGIN   :::   RECOVER PASS   :::   GET ACCOUNT    
Browse
  • Projects
  • Code (CVS)
  • Forums
  • News
  • Articles
  • Polls
  •  
    OpenCores
  • FAQ
  • CVS HowTo
  • Mission
  • Media
  • Tools
  • Advertise
  • Mirrors
  • Logos
  • Contact us
  • Find Resources
  • Job Opportunity
  •  
    Tools
  • Search
      
  • Download Cores (CVSGet)
  •  
    More
  • Wishbone
  • Perlilog
  • EDA tools
  • OpenTech CD
  •  
    Navigation: All forums > Openrisc > Message List > Message Post

    Message

    Reply | Reply all
    Date Prev | Date Next | Thread Prev | Thread Next Date Index | Thread Index

    From: Stephan<stephan@m...>
    Date: Sat Oct 8 10:00:20 CEST 2005
    Subject: [openrisc] exec_log_start/end custom patch
    Top
    * Gy?rgy 'nog' Jeney <nog@s...> [2005-10-06 09:06:46]:

    > int_val should stay as int. You should create a new config file parameter
    > type by extending the param_t enum and the param_val union in sim-config.h and
    > add the relevent bits to parse the new type to get_paramt_str() and
    > switch_param() in sim-config.c. And then ofcourse change the exe_log call to
    > reg_config_param() in reg_sim_sec() to use your new config file parameter type.

    I followed your advice and fixed it the proper way. The attached patch will change
    sim-config.[ch].

    I have a question about the sim... check out this output:

    =========================================================================
    run <instructions> [<hush>] - execute <instruction> instructions, no reg dump
    if hush

    sim) run 4000000000 hush
    (sim) r
    00002010: : 15000000 l.nop 0 (executed) [cycle 2147483650, #2147483648]

    (sim) run 4000000000 hush
    (sim) r
    0000200c: : 00000000 l.j 0x0 (executed) [cycle 4294967297, #4294967295]
    ==========================================================================

    When I do 'run 4000000000 hush', shouldn't the cycle count be almost double
    the value shown? I told the sim to execute 4 billion instructions, and yet the
    cycle count is at 2.1 billion.

    Stephan




    -------------- next part --------------
    --- or1k/or1ksim/sim-config.h 2005-09-05 04:47:23.000000000 -0400
    +++ tmp/or1ksim/sim-config.h 2005-10-08 01:33:13.000000000 -0400
    @@ -132,8 +132,8 @@ struct config {
    int history; /* instruction stream history analysis */
    int exe_log; /* Print out RTL states? */
    int exe_log_type; /* Type of log */
    - int exe_log_start; /* First instruction to log */
    - int exe_log_end; /* Last instruction to log, -1 if continuous */
    + long long int exe_log_start; /* First instruction to log */
    + long long int exe_log_end; /* Last instruction to log, -1 if continuous */
    int exe_log_marker; /* If nonzero, place markers before each exe_log_marker instructions */
    char exe_log_fn[STR_SIZE]; /* RTL state comparison filename */
    char fstdout[STR_SIZE]; /* stdout filename */
    @@ -265,6 +265,7 @@ void reg_sim_stat(void (*stat_func)(void
    union param_val {
    char *str_val;
    int int_val;
    + long long int longlong_val;
    oraddr_t addr_val;
    };

    @@ -273,6 +274,7 @@ enum param_t {
    paramt_str, /* String parameter enclosed in double quotes (") */
    paramt_word, /* String parameter NOT enclosed in double quotes */
    paramt_int, /* Integer parameter */
    + paramt_longlong, /* Long long int parameter */
    paramt_addr /* Address parameter */
    };

    --- or1k/or1ksim/sim-config.c 2005-09-05 04:52:28.000000000 -0400
    +++ tmp/or1ksim/sim-config.c 2005-10-08 01:43:13.000000000 -0400
    @@ -352,11 +352,11 @@ void sim_exe_log_type (union param_val v
    }

    void sim_exe_log_start (union param_val val, void *dat) {
    - config.sim.exe_log_start = val.int_val;
    + config.sim.exe_log_start = val.longlong_val;
    }

    void sim_exe_log_end (union param_val val, void *dat) {
    - config.sim.exe_log_end = val.int_val;
    + config.sim.exe_log_end = val.longlong_val;
    }

    void sim_exe_log_marker (union param_val val, void *dat) {
    @@ -404,8 +404,8 @@ void reg_sim_sec (void) {
    reg_config_param(sec, "history", paramt_int, sim_history);
    reg_config_param(sec, "exe_log", paramt_int, sim_exe_log);
    reg_config_param(sec, "exe_log_type", paramt_word, sim_exe_log_type);
    - reg_config_param(sec, "exe_log_start", paramt_int, sim_exe_log_start);
    - reg_config_param(sec, "exe_log_end", paramt_int, sim_exe_log_end);
    + reg_config_param(sec, "exe_log_start", paramt_longlong, sim_exe_log_start);
    + reg_config_param(sec, "exe_log_end", paramt_longlong, sim_exe_log_end);
    reg_config_param(sec, "exe_log_marker", paramt_int, sim_exe_log_marker);
    reg_config_param(sec, "exe_log_fn", paramt_str, sim_exe_log_fn);
    reg_config_param(sec, "clkcycle", paramt_word, sim_clkcycle);
    @@ -500,6 +500,8 @@ static char *get_paramt_str(enum param_t
    switch(type) {
    case paramt_int:
    return "integer";
    + case paramt_longlong:
    + return "longlong";
    case paramt_addr:
    return "address";
    case paramt_str:
    @@ -580,6 +582,11 @@ static void switch_param(char *param, st
    switch (cur_param->type) { case paramt_int: val.int_val = strtol(param, NULL, 0); + break; + case paramt_longlong: + val.longlong_val = strtoll(param, NULL, 0); + printf("DEBUG STEPHAM: %lld\n", val.longlong_val); + break; case paramt_addr: val.addr_val = strtoul(param, NULL, 0); break;

    Follow upAuthor
    [openrisc] exec_log_start/end custom patchStephan

     
    Copyright (c) 1999 OPENCORES.ORG. All rights reserved.