Skip to content

Commit

Permalink
Implement emulation::run
Browse files Browse the repository at this point in the history
  • Loading branch information
IHatePineapples committed Apr 28, 2024
1 parent 1610404 commit e56c02d
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/RoL/emulation/emulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,26 @@ job_t current_job = {};
namespace emulation
{

#if !RoL_testing
void run()
{
// Nothing yet
start_run:
while (in_jq_.empty())
{
/** Busy wait until a job is available*/
sleep_ms(2); // Sleeping to reduce CPU busy time slightly.
}

auto &[id, state] = in_jq_.front();

state.execute();

out_jq_.push({id, state});
in_jq_.pop();
goto start_run;
}
#endif

template <std::size_t n = 11>
static constexpr reg sign_extend(std::bitset<n> imm, std::size_t msb_pos = (n - 1))
{
Expand Down

0 comments on commit e56c02d

Please sign in to comment.