Skip to content

Need restart function for scheduler to avoid recursively call scheduler->run() #478

@littlewin-wang

Description

@littlewin-wang

In my simulator based on sparta,I need flush all inflight events in my flush process, which means I need stop, clear events and re-run the scheduler.
While my flush function is in one event handler, so actually I use scheduler->run() in recursive.

The flush event handler in my flush manager

      void FlushManager::ForwardingFlushSignal(const FlushingCriteria& flush_criteria) {
        auto tick = scheduler_->getCurrentTick();
        scheduler_->stopRunning();
        scheduler_->restartAt(tick);
        flush_criteria_ = flush_criteria;
        flush_event_.schedule(1);
        scheduler_->run();
    }

It is handler bind to one inPort

rob_flush_manager_in.registerConsumerHandler(
                CREATE_SPARTA_HANDLER_WITH_DATA(FlushManager, ForwardingFlushSignal, FlushingCriteria));

I don't want to recursively call func, it may cause memory usage problem

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: spartaIssue is related to sparta frameworkenhancementEnhancement or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions