2024-10-12 23:16:16 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
#include <optional>
|
|
|
|
|
#include <functional>
|
|
|
|
|
|
|
|
|
|
#include "src/Targets/RiscV/RiscV.hpp"
|
|
|
|
|
|
|
|
|
|
#include "TargetDescriptionFile.hpp"
|
|
|
|
|
|
|
|
|
|
namespace Targets::RiscV::Wch
|
|
|
|
|
{
|
2024-11-16 20:05:26 +00:00
|
|
|
class WchRiscV: public ::Targets::RiscV::RiscV
|
2024-10-12 23:16:16 +01:00
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
WchRiscV(const TargetConfig& targetConfig, TargetDescriptionFile&& targetDescriptionFile);
|
|
|
|
|
|
|
|
|
|
void activate() override;
|
|
|
|
|
void postActivate() override;
|
|
|
|
|
TargetDescriptor targetDescriptor() override;
|
|
|
|
|
|
2024-12-05 23:09:01 +00:00
|
|
|
void setProgramBreakpoint(const TargetProgramBreakpoint& breakpoint) override;
|
|
|
|
|
void removeProgramBreakpoint(const TargetProgramBreakpoint& breakpoint) override;
|
|
|
|
|
|
2024-11-16 20:05:26 +00:00
|
|
|
void writeMemory(
|
|
|
|
|
const TargetAddressSpaceDescriptor& addressSpaceDescriptor,
|
|
|
|
|
const TargetMemorySegmentDescriptor& memorySegmentDescriptor,
|
|
|
|
|
TargetMemoryAddress startAddress,
|
2024-11-16 21:49:49 +00:00
|
|
|
TargetMemoryBufferSpan buffer
|
2024-11-16 20:05:26 +00:00
|
|
|
) override;
|
|
|
|
|
|
2024-10-12 23:16:16 +01:00
|
|
|
protected:
|
|
|
|
|
TargetDescriptionFile targetDescriptionFile;
|
|
|
|
|
std::optional<std::reference_wrapper<const TargetDescription::Variant>> variant = std::nullopt;
|
2024-11-16 20:05:26 +00:00
|
|
|
|
|
|
|
|
const TargetMemorySegmentDescriptor& programMemorySegmentDescriptor;
|
2024-12-05 23:09:01 +00:00
|
|
|
const TargetMemorySegmentDescriptor& bootProgramMemorySegmentDescriptor;
|
2024-11-16 20:05:26 +00:00
|
|
|
const TargetMemorySegmentDescriptor& mappedProgramMemorySegmentDescriptor;
|
2024-12-05 23:09:01 +00:00
|
|
|
|
|
|
|
|
const TargetMemorySegmentDescriptor& getDestinationProgramMemorySegmentDescriptor();
|
|
|
|
|
TargetMemoryAddress transformAliasedProgramMemoryAddress(TargetMemoryAddress address) const;
|
2024-10-12 23:16:16 +01:00
|
|
|
};
|
|
|
|
|
}
|