<commit_before>
pub struct ProcessorInterface;

impl ProcessorInterface {

    pub fn new() -> ProcessorInterface {
        ProcessorInterface
    }
 
    pub fn read_u32(&self, register: u32) -> u32 {
        println!("READ PI");
        0
    }

    pub fn write_u32(&mut self, register: u32, val: u32) {
        println!("WRITE PI");
    }

}<commit_msg>processor interface updates<commit_after>
const INTERRUPT_CAUSE: u32 = 0x00;
const INTERRUPT_MASK:  u32 = 0x04;
const RESET_CODE:      u32 = 0x24;
const REVISION:        u32 = 0x2C;
const UNKNOWN:         u32 = 0x30;

pub struct ProcessorInterface {
    interrupt_mask: u32,
    reset_code: u32,
    revision: u32
}

impl ProcessorInterface {

    pub fn new() -> ProcessorInterface {
        ProcessorInterface {
            interrupt_mask: 0,
            reset_code: 0,
            revision: 0x246500B1 // revision C
        }
    }
 
    pub fn read_u32(&self, register: u32) -> u32 {
        match register {
            RESET_CODE => self.reset_code,
            REVISION => self.revision,
            _ => panic!("unrecognized pi register {:#x}", register)
        }
    }

    pub fn write_u32(&mut self, register: u32, val: u32) {
        match register {
            INTERRUPT_CAUSE => panic!("PI: Interrupt {}", val),
            INTERRUPT_MASK => self.interrupt_mask = val,
            RESET_CODE => self.reset_code = val,
            UNKNOWN => {}, // ignore value written to unknown reg
            _ => panic!("unrecognized pi register {:#x} {:#x}", register, val)
        }
    }
}
{'fraction_non_alphanumeric': 0.1107533805537669, 'fraction_numerical': 0.04185447520927238, 'mean_word_length': 2.152129817444219, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7558743', 'n_tokens_mistral': 537, 'n_tokens_neox': 478, 'n_words': 128}