URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Show entire file |
Details |
Blame |
View Log
Rev 6 |
Rev 462 |
Line 34... |
Line 34... |
|
|
//! @param name Name of this module, passed to the parent
|
//! @param name Name of this module, passed to the parent
|
//! constructor.
|
//! constructor.
|
//! @param resetCounter Number of cycles of reset to provide.
|
//! @param resetCounter Number of cycles of reset to provide.
|
|
|
ResetSC::ResetSC (sc_core::sc_module_name name,
|
ResetSC::ResetSC(sc_core::sc_module_name name, int _resetCounter):
|
int _resetCounter) :
|
sc_module(name), resetCounter(_resetCounter)
|
sc_module (name),
|
|
resetCounter (_resetCounter)
|
|
{
|
{
|
SC_METHOD (driveReset);
|
SC_METHOD (driveReset);
|
sensitive << clk.neg();
|
sensitive << clk.neg();
|
|
|
} // ResetSC ()
|
} // ResetSC ()
|
|
|
|
|
//! Method to drive the reset port (active low). We will be called as an
|
//! Method to drive the reset port (active low). We will be called as an
|
//! initialization, which can be used to drive the reset low.
|
//! initialization, which can be used to drive the reset low.
|
void
|
void ResetSC::driveReset()
|
ResetSC::driveReset()
|
|
{
|
|
if (resetCounter > 0)
|
|
{
|
{
|
|
if (resetCounter > 0) {
|
rst = 1;
|
rst = 1;
|
rstn = 0;
|
rstn = 0;
|
resetCounter--;
|
resetCounter--;
|
}
|
} else {
|
else
|
|
{
|
|
rst = 0;
|
rst = 0;
|
rstn = 1;
|
rstn = 1;
|
}
|
}
|
} // driveReset()
|
} // driveReset()
|
|
|
|
|
No newline at end of file
|
No newline at end of file
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.