# Copyright lowRISC contributors. | |
# Licensed under the Apache License, Version 2.0, see LICENSE for details. | |
# SPDX-License-Identifier: Apache-2.0 | |
"""Enumerated types for fields | |
Generated by validation, used by backends | |
""" | |
from enum import Enum | |
class JsonEnum(Enum): | |
def for_json(x): | |
return str(x) | |
class SwWrAccess(JsonEnum): | |
WR = 1 | |
NONE = 2 | |
class SwRdAccess(JsonEnum): | |
RD = 1 | |
RC = 2 # Special handling for port | |
NONE = 3 | |
class SwAccess(JsonEnum): | |
RO = 1 | |
RW = 2 | |
WO = 3 | |
W1C = 4 | |
W1S = 5 | |
W0C = 6 | |
RC = 7 | |
R0W1C = 8 | |
NONE = 9 | |
class HwAccess(JsonEnum): | |
HRO = 1 | |
HRW = 2 | |
HWO = 3 | |
NONE = 4 # No access allowed |