amos 2f32624d3b Batch 18 (20261026-C-hwe-codegen-18): add 100 calibrated HWE code-gen tasks; pause production for rollout
100 tasks from the HWE arm-linux code-gen pool (outside the lk/man/pth
range given to batch 22), each with at least one independent
contract-edge defect and plain public docs. Claude reviewed 100/100
USABLE against current digests; no ID or source overlap with main or
batch 22. Difficulty is unmeasured.

progress.md records the wrap-up: all Codex sessions and Qwen schedulers
stopped for the user's rollout, Qwen results so far (57 HARD of 373),
and what is left on each batch branch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 17:52:13 +08:00

59 lines
1.9 KiB
C++

#ifndef CLOCK_MODEL_HPP
#define CLOCK_MODEL_HPP
#include <array>
#include <cstdint>
#include <deque>
#include <string>
#include <vector>
namespace clockmodel {
using Arg = std::int64_t;
using Word = std::uint32_t;
struct Reply {
std::string status;
std::vector<Word> values;
};
struct Event {
Word reg;
Word value;
};
struct Device {
std::array<Word, 4> regs{};
std::deque<Word> fifo;
std::deque<Event> events;
};
class Bus {
public:
Bus();
Reply read(Arg id, Arg reg) const;
Reply write(Arg id, Arg reg, Arg value);
Reply configure(Arg id, Arg clock, Arg reset, Arg enable, Arg data);
Reply burst(Arg id, const std::vector<Arg>& values);
Reply drain(Arg id, Arg count);
Reply snapshot(Arg id) const;
Reply history(Arg id, Arg count) const;
Reply clear(Arg id);
private:
std::array<Device, 8> devices_;
static bool valid_id(Arg id);
static bool valid_reg(Arg reg);
static bool valid_word(Arg value);
static bool valid_count(Arg count, Arg maximum);
static bool clock_on(const Device& device);
static bool reset_released(const Device& device);
static bool enabled(const Device& device);
static Reply error(const std::string& code);
static Reply success();
static Reply single(Word value);
static void record(Device& device, Word reg, Word value);
static std::string data_permission(const Device& device);
static std::string apply(Device& device, Word reg, Word value);
static std::string set_clock(Device& device, Word value);
static std::string set_reset(Device& device, Word value);
static std::string set_enable(Device& device, Word value);
static std::string set_data(Device& device, Word value);
static std::vector<Word> export_snapshot(const Device& device);
static std::vector<Word> export_history(const Device& device, std::size_t count);
};
}
#endif