renode icon indicating copy to clipboard operation
renode copied to clipboard

LimitTimer can be created with Frequency '-1' and resetting it sets freq to 0.

Open Mes-ser opened this issue 1 year ago • 0 comments

Description

When LimitTimer is used, you need to provide frequency which is != 0, so when value -1 is used the constructor takes it, then while doing reset on LimitTimer, the frequency is set to 0.

Expected behaviour

No possibility to set frequency to <= 0.

How to reproduce?

Renode instance with created machine, and loaded peripheral which use LimitTimer (Let's call it Task) which was created with frequency set to -1

  • In Monitor window call "machine GetTimeSourceInfo"
  • Check frequency for 'Task', should be '-1'
  • Reset this object by calling 'Task.Reset()' method on it
  • In Monitor windows call "machine GetTimeSourceInfo"
  • Our Task now has frequency set to '0'

Environment

Please, provide the following information:

  • Windows 10 / Ubuntu 23.10
  • Renode version: v1.15.0.30170 / 1.14.0

Do you plan to address this issue and file a PR?

Not right now.

Mes-ser avatar Mar 25 '24 20:03 Mes-ser