Skip to content

Self modifying code breaks. #4

@ghost

Description

If the CPU writes to an address which has already been prefetched it should flush the prefetch cache. Otherwise unknown behaviour occurs.

reproduced using ao68000 to run the atari operating system TOS1.04

Patch below... line numbers may be wrong...

Index: C:/Users/Stephen/Documents/Xilinx/AtariST/ao68000.v

--- C:/Users/Stephen/Documents/Xilinx/AtariST/ao68000.v (revision 30)
+++ C:/Users/Stephen/Documents/Xilinx/AtariST/ao68000.v (working copy)
@@ -1136,6 +1136,14 @@
CYC_O <= 1'b1;
ADR_O <= address_i[31:2];
STB_O <= 1'b1;

  •                           if ((address_i - pc_i) <= 8) begin
    
  •                               prefetch_ir_valid_32_o <= 1'b0;
    
  •                               prefetch_ir_valid_o <= 1'b0;
    
  •                               prefetch_ir_valid_80_o <= 1'b0;
    
  •                           end
    
                     if(address_i[1:0] == 2'b10 && size_i[2] == 1'b1) begin
                         DAT_O <= { 16'b0, data_write_i[31:16] };
    

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions