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: =?unknown-8bit?Q?Gy=F6rgy?= 'nog' Jeney<nog@s...>
    Date: Wed Jun 29 16:56:50 CEST 2005
    Subject: [openrisc] [or1ksim #121] Add cycles debug channel
    Top
    Hi,

    This adds a `cycles' debug channel that prepends the current simulator cycles
    to each printed line.

    ChangeLog:
    * Add the cycles debug channel to print the value of the cycle counter before
    each line.

    nog.
    -------------- next part --------------
    diff -upr --unidirectional-new-file ./support/debug.c /home/nog/or1ksim-ac/support/debug.c
    --- ./support/debug.c 2005-03-25 13:20:53.000000000 +0100
    +++ /home/nog/or1ksim-ac/support/debug.c 2005-06-09 15:46:33.000000000 +0200
    @@ -21,6 +21,16 @@ Foundation, Inc., 675 Mass Ave, Cambridg
    #include <stdarg.h>
    #include <string.h>

    +#include "config.h"
    +
    +#ifdef HAVE_INTTYPES_H
    +#include <inttypes.h>
    +#endif
    +
    +#include "port.h"
    +#include "arch.h"
    +#include "sim-config.h"
    +
    #define __ORSIM_NO_DEC_DBCH
    #include "debug.h"

    @@ -45,8 +55,13 @@ void orsim_dbg_log(enum __ORSIM_DEBUG_CL
    if(!(dbch[0] & (1 << dbcl)))
    return;

    - if(last_lf)
    - fprintf(stderr, "%s:%s:%s: ", debug_classes[dbcl], dbch + 1, function);
    + if(last_lf) {
    + if(!TRACE_ON(cycles))
    + fprintf(stderr, "%s:%s:%s: ", debug_classes[dbcl], dbch + 1, function);
    + else
    + fprintf(stderr, "%lld:%s:%s:%s: ", runtime.sim.cycles,
    + debug_classes[dbcl], dbch + 1, function);
    + }
    last_lf = format[strlen(format) - 1] == '\n'; /* This is wrong... */
    va_start(ap, format);
    vfprintf(stderr, format, ap);
    diff -upr --unidirectional-new-file ./support/dbchs.h /home/nog/or1ksim-ac/support/dbchs.h
    --- ./support/dbchs.h 2005-06-28 15:41:34.000000000 +0200
    +++ /home/nog/or1ksim-ac/support/dbchs.h 2005-06-28 11:54:59.000000000 +0200
    @@ -21,6 +21,7 @@ Foundation, Inc., 675 Mass Ave, Cambridg
    /* Declatrations of all debug channels */
    DECLARE_DEBUG_CHANNEL(sched)
    DECLARE_DEBUG_CHANNEL(except)
    +DECLARE_DEBUG_CHANNEL(cycles)
    DECLARE_DEBUG_CHANNEL(immu)
    DECLARE_DEBUG_CHANNEL(dmmu)
    DECLARE_DEBUG_CHANNEL(pic)

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