Allow positive floats as frequency for traffic initiators.
This commit is contained in:
@@ -61,15 +61,11 @@ TraceSetup::TraceSetup(const std::string &uri,
|
||||
if (!value.empty())
|
||||
{
|
||||
sc_time playerClk;
|
||||
if (!value["clkMhz"].is_number_unsigned())
|
||||
SC_REPORT_FATAL("TraceSetup", "Frequency is not a number.");
|
||||
if (!value["clkMhz"].is_number() || value["clkMhz"] <= 0)
|
||||
SC_REPORT_FATAL("TraceSetup", "Frequency is not a positive number.");
|
||||
|
||||
unsigned int frequencyMHz = value["clkMhz"];
|
||||
|
||||
if (frequencyMHz == 0)
|
||||
SC_REPORT_FATAL("TraceSetup", "Frequency must not be zero.");
|
||||
else
|
||||
playerClk = sc_time(1.0 / frequencyMHz, SC_US);
|
||||
double frequencyMHz = value["clkMhz"];
|
||||
playerClk = sc_time(1.0 / frequencyMHz, SC_US);
|
||||
|
||||
if (!value["name"].is_string())
|
||||
SC_REPORT_FATAL("TraceSetup", "No trace name defined.");
|
||||
|
||||
Reference in New Issue
Block a user