OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [or1ksim/] [libtoplevel.c] - Diff between revs 97 and 98

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 97 Rev 98
Line 416... Line 416...
   @return  The time in seconds which the reset took.                        */
   @return  The time in seconds which the reset took.                        */
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
double
double
or1ksim_jtag_reset ()
or1ksim_jtag_reset ()
{
{
  return  (double) jtag_reset () * (double) config.debug.jtagcycle_ps / 1.0e12;
  /* Number of JTAG clock cycles a reset sequence takes */
 
  const double  JTAG_RESET_CYCLES = 5.0;
 
 
 
  jtag_reset ();
 
 
 
  return  JTAG_RESET_CYCLES  * (double) config.debug.jtagcycle_ps / 1.0e12;
 
 
}       /* or1ksim_jtag_reset () */
}       /* or1ksim_jtag_reset () */
 
 
 
 
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
Line 440... Line 445...
   this model is DEBUG. For completeness the register is parsed and a warning
   this model is DEBUG. For completeness the register is parsed and a warning
   given if any register other than DEBUG is shifted.
   given if any register other than DEBUG is shifted.
 
 
   @param[in,out] jreg  The register to shift in, and the register shifted
   @param[in,out] jreg  The register to shift in, and the register shifted
                        back out.
                        back out.
 
   @param[in]     num_bits  The number of bits in the register. Just for
 
                            sanity check (it should always be 4).
 
 
   @return  The time in seconds which the shift took.                        */
   @return  The time in seconds which the shift took.                        */
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
double
double
or1ksim_jtag_shift_ir (unsigned char *jreg)
or1ksim_jtag_shift_ir (unsigned char *jreg,
 
                       int            num_bits)
{
{
  return  (double) jtag_shift_ir (jreg) * (double) config.debug.jtagcycle_ps /
  jtag_shift_ir (jreg, num_bits);
          1.0e12;
 
 
  return  (double) num_bits * (double) config.debug.jtagcycle_ps / 1.0e12;
 
 
}       /* or1ksim_jtag_shift_ir () */
}       /* or1ksim_jtag_shift_ir () */
 
 
 
 
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
Line 479... Line 488...
   @note In practice READ_COMMAND is not used. However the functionality is
   @note In practice READ_COMMAND is not used. However the functionality is
         provided for future compatibility.
         provided for future compatibility.
 
 
   @param[in,out] jreg  The register to shift in, and the register shifted
   @param[in,out] jreg  The register to shift in, and the register shifted
                        back out.
                        back out.
 
   @param[in]     num_bits  The number of bits in the register. This is
 
                            essential to prevent bugs where the size of
 
                            register supplied is incorrect.
 
 
   @return  The time in seconds which the shift took.                        */
   @return  The time in seconds which the shift took.                        */
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
double
double
or1ksim_jtag_shift_dr (unsigned char *jreg)
or1ksim_jtag_shift_dr (unsigned char *jreg,
 
                       int            num_bits)
{
{
  return  (double) jtag_shift_dr (jreg) * (double) config.debug.jtagcycle_ps /
  jtag_shift_dr (jreg, num_bits);
          1.0e12;
 
 
  return  (double) num_bits * (double) config.debug.jtagcycle_ps / 1.0e12;
 
 
}       /* or1ksim_jtag_shift_dr () */
}       /* or1ksim_jtag_shift_dr () */
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.