data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v
 line:10: before: "bFQTPauqsf4LKBh"
1: b'%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:3: Cannot find include file: cpu.v\n`include "cpu.v" \n         ^~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/200314387/verilog/cpu,data/full_repos/permissive/200314387/cpu.v\n             data/full_repos/permissive/200314387/verilog/cpu,data/full_repos/permissive/200314387/cpu.v.v\n             data/full_repos/permissive/200314387/verilog/cpu,data/full_repos/permissive/200314387/cpu.v.sv\n             cpu.v\n             cpu.v.v\n             cpu.v.sv\n             obj_dir/cpu.v\n             obj_dir/cpu.v.v\n             obj_dir/cpu.v.sv\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:4: Cannot find include file: ../lib/assertion.v\n`include "../lib/assertion.v" \n         ^~~~~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:5: Cannot find include file: psuedo_assembler.sv\n`include "psuedo_assembler.sv" \n         ^~~~~~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:17: Cannot find include file: ../lib/display_snippet.sv\n   `include "../lib/display_snippet.sv" \n            ^~~~~~~~~~~~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:15: syntax error, unexpected IDENTIFIER, expecting PACKAGE-IDENTIFIER or STRING\n    import alu_ops::*;\n           ^~~~~~~\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:27: Define or directive not defined: \'`DEFINE_CODE_VARS\'\n    `DEFINE_CODE_VARS(MAX_PC)\n    ^~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:27: syntax error, unexpected \'(\'\n    `DEFINE_CODE_VARS(MAX_PC)\n                      ^~~~~~\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:51: Define or directive not defined: \'`INSTRUCTION\'\n        `INSTRUCTION(icount,    B,      rega,     rega,   immed,  A,      `SET_FLAGS, `CM_STD,    `NA_AMODE,  \'z,     8\'h11); \n        ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:51: syntax error, unexpected \',\'\n        `INSTRUCTION(icount,    B,      rega,     rega,   immed,  A,      `SET_FLAGS, `CM_STD,    `NA_AMODE,  \'z,     8\'h11); \n                           ^\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:51: Define or directive not defined: \'`SET_FLAGS\'\n        `INSTRUCTION(icount,    B,      rega,     rega,   immed,  A,      `SET_FLAGS, `CM_STD,    `NA_AMODE,  \'z,     8\'h11); \n                                                                          ^~~~~~~~~~\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:51: Define or directive not defined: \'`CM_STD\'\n        `INSTRUCTION(icount,    B,      rega,     rega,   immed,  A,      `SET_FLAGS, `CM_STD,    `NA_AMODE,  \'z,     8\'h11); \n                                                                                      ^~~~~~~\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:51: Define or directive not defined: \'`NA_AMODE\'\n        `INSTRUCTION(icount,    B,      rega,     rega,   immed,  A,      `SET_FLAGS, `CM_STD,    `NA_AMODE,  \'z,     8\'h11); \n                                                                                                  ^~~~~~~~~\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:52: Define or directive not defined: \'`INSTRUCTION\'\n        `INSTRUCTION(icount,    B,      regb,     regb,   immed,  A,      `KEEP_FLAGS,`CM_STD,    `NA_AMODE,  \'z,     8\'h22); \n        ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:52: syntax error, unexpected \',\'\n        `INSTRUCTION(icount,    B,      regb,     regb,   immed,  A,      `KEEP_FLAGS,`CM_STD,    `NA_AMODE,  \'z,     8\'h22); \n                           ^\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:52: Define or directive not defined: \'`KEEP_FLAGS\'\n        `INSTRUCTION(icount,    B,      regb,     regb,   immed,  A,      `KEEP_FLAGS,`CM_STD,    `NA_AMODE,  \'z,     8\'h22); \n                                                                          ^~~~~~~~~~~\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:52: Define or directive not defined: \'`CM_STD\'\n        `INSTRUCTION(icount,    B,      regb,     regb,   immed,  A,      `KEEP_FLAGS,`CM_STD,    `NA_AMODE,  \'z,     8\'h22); \n                                                                                      ^~~~~~~\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:52: Define or directive not defined: \'`NA_AMODE\'\n        `INSTRUCTION(icount,    B,      regb,     regb,   immed,  A,      `KEEP_FLAGS,`CM_STD,    `NA_AMODE,  \'z,     8\'h22); \n                                                                                                  ^~~~~~~~~\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:53: Define or directive not defined: \'`INSTRUCTION\'\n        `INSTRUCTION(icount,    B,      regc,     regc,   immed,  A,      `SET_FLAGS, `CM_STD,    `NA_AMODE,  \'z,     8\'h33); \n        ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:53: syntax error, unexpected \',\'\n        `INSTRUCTION(icount,    B,      regc,     regc,   immed,  A,      `SET_FLAGS, `CM_STD,    `NA_AMODE,  \'z,     8\'h33); \n                           ^\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:53: Define or directive not defined: \'`SET_FLAGS\'\n        `INSTRUCTION(icount,    B,      regc,     regc,   immed,  A,      `SET_FLAGS, `CM_STD,    `NA_AMODE,  \'z,     8\'h33); \n                                                                          ^~~~~~~~~~\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:53: Define or directive not defined: \'`CM_STD\'\n        `INSTRUCTION(icount,    B,      regc,     regc,   immed,  A,      `SET_FLAGS, `CM_STD,    `NA_AMODE,  \'z,     8\'h33); \n                                                                                      ^~~~~~~\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:53: Define or directive not defined: \'`NA_AMODE\'\n        `INSTRUCTION(icount,    B,      regc,     regc,   immed,  A,      `SET_FLAGS, `CM_STD,    `NA_AMODE,  \'z,     8\'h33); \n                                                                                                  ^~~~~~~~~\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:54: Define or directive not defined: \'`INSTRUCTION\'\n        `INSTRUCTION(icount,    B,      regd,     regd,   immed,  A,      `KEEP_FLAGS,`CM_STD,    `NA_AMODE,  \'z,     8\'h44); \n        ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:54: syntax error, unexpected \',\'\n        `INSTRUCTION(icount,    B,      regd,     regd,   immed,  A,      `KEEP_FLAGS,`CM_STD,    `NA_AMODE,  \'z,     8\'h44); \n                           ^\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:54: Define or directive not defined: \'`KEEP_FLAGS\'\n        `INSTRUCTION(icount,    B,      regd,     regd,   immed,  A,      `KEEP_FLAGS,`CM_STD,    `NA_AMODE,  \'z,     8\'h44); \n                                                                          ^~~~~~~~~~~\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:54: Define or directive not defined: \'`CM_STD\'\n        `INSTRUCTION(icount,    B,      regd,     regd,   immed,  A,      `KEEP_FLAGS,`CM_STD,    `NA_AMODE,  \'z,     8\'h44); \n                                                                                      ^~~~~~~\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:54: Define or directive not defined: \'`NA_AMODE\'\n        `INSTRUCTION(icount,    B,      regd,     regd,   immed,  A,      `KEEP_FLAGS,`CM_STD,    `NA_AMODE,  \'z,     8\'h44); \n                                                                                                  ^~~~~~~~~\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:55: Define or directive not defined: \'`INSTRUCTION\'\n        `INSTRUCTION(icount,    B,      porta,    rega,   rega,   A,      `SET_FLAGS, `CM_STD,    `NA_AMODE,  \'z,     8\'h0); \n        ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:55: syntax error, unexpected \',\'\n        `INSTRUCTION(icount,    B,      porta,    rega,   rega,   A,      `SET_FLAGS, `CM_STD,    `NA_AMODE,  \'z,     8\'h0); \n                           ^\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:55: Define or directive not defined: \'`SET_FLAGS\'\n        `INSTRUCTION(icount,    B,      porta,    rega,   rega,   A,      `SET_FLAGS, `CM_STD,    `NA_AMODE,  \'z,     8\'h0); \n                                                                          ^~~~~~~~~~\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:55: Define or directive not defined: \'`CM_STD\'\n        `INSTRUCTION(icount,    B,      porta,    rega,   rega,   A,      `SET_FLAGS, `CM_STD,    `NA_AMODE,  \'z,     8\'h0); \n                                                                                      ^~~~~~~\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:55: Define or directive not defined: \'`NA_AMODE\'\n        `INSTRUCTION(icount,    B,      porta,    rega,   rega,   A,      `SET_FLAGS, `CM_STD,    `NA_AMODE,  \'z,     8\'h0); \n                                                                                                  ^~~~~~~~~\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:56: Define or directive not defined: \'`INSTRUCTION\'\n        `INSTRUCTION(icount,    B,      porta,    regb,   regb,   A,      `KEEP_FLAGS,`CM_STD,    `NA_AMODE,  \'z,     8\'h0); \n        ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:56: syntax error, unexpected \',\'\n        `INSTRUCTION(icount,    B,      porta,    regb,   regb,   A,      `KEEP_FLAGS,`CM_STD,    `NA_AMODE,  \'z,     8\'h0); \n                           ^\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:56: Define or directive not defined: \'`KEEP_FLAGS\'\n        `INSTRUCTION(icount,    B,      porta,    regb,   regb,   A,      `KEEP_FLAGS,`CM_STD,    `NA_AMODE,  \'z,     8\'h0); \n                                                                          ^~~~~~~~~~~\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:56: Define or directive not defined: \'`CM_STD\'\n        `INSTRUCTION(icount,    B,      porta,    regb,   regb,   A,      `KEEP_FLAGS,`CM_STD,    `NA_AMODE,  \'z,     8\'h0); \n                                                                                      ^~~~~~~\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:56: Define or directive not defined: \'`NA_AMODE\'\n        `INSTRUCTION(icount,    B,      porta,    regb,   regb,   A,      `KEEP_FLAGS,`CM_STD,    `NA_AMODE,  \'z,     8\'h0); \n                                                                                                  ^~~~~~~~~\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:57: Define or directive not defined: \'`INSTRUCTION\'\n        `INSTRUCTION(icount,    B,      porta,    regc,   regc,   A,      `SET_FLAGS, `CM_STD,    `NA_AMODE,  \'z,     8\'h0); \n        ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:57: syntax error, unexpected \',\'\n        `INSTRUCTION(icount,    B,      porta,    regc,   regc,   A,      `SET_FLAGS, `CM_STD,    `NA_AMODE,  \'z,     8\'h0); \n                           ^\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:57: Define or directive not defined: \'`SET_FLAGS\'\n        `INSTRUCTION(icount,    B,      porta,    regc,   regc,   A,      `SET_FLAGS, `CM_STD,    `NA_AMODE,  \'z,     8\'h0); \n                                                                          ^~~~~~~~~~\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:57: Define or directive not defined: \'`CM_STD\'\n        `INSTRUCTION(icount,    B,      porta,    regc,   regc,   A,      `SET_FLAGS, `CM_STD,    `NA_AMODE,  \'z,     8\'h0); \n                                                                                      ^~~~~~~\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:57: Define or directive not defined: \'`NA_AMODE\'\n        `INSTRUCTION(icount,    B,      porta,    regc,   regc,   A,      `SET_FLAGS, `CM_STD,    `NA_AMODE,  \'z,     8\'h0); \n                                                                                                  ^~~~~~~~~\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:58: Define or directive not defined: \'`INSTRUCTION\'\n        `INSTRUCTION(icount,    B,      porta,    regd,   regd,   A,      `KEEP_FLAGS,`CM_STD,    `NA_AMODE,  \'z,     8\'h0); \n        ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:58: syntax error, unexpected \',\'\n        `INSTRUCTION(icount,    B,      porta,    regd,   regd,   A,      `KEEP_FLAGS,`CM_STD,    `NA_AMODE,  \'z,     8\'h0); \n                           ^\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:58: Define or directive not defined: \'`KEEP_FLAGS\'\n        `INSTRUCTION(icount,    B,      porta,    regd,   regd,   A,      `KEEP_FLAGS,`CM_STD,    `NA_AMODE,  \'z,     8\'h0); \n                                                                          ^~~~~~~~~~~\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:58: Define or directive not defined: \'`CM_STD\'\n        `INSTRUCTION(icount,    B,      porta,    regd,   regd,   A,      `KEEP_FLAGS,`CM_STD,    `NA_AMODE,  \'z,     8\'h0); \n                                                                                      ^~~~~~~\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:58: Define or directive not defined: \'`NA_AMODE\'\n        `INSTRUCTION(icount,    B,      porta,    regd,   regd,   A,      `KEEP_FLAGS,`CM_STD,    `NA_AMODE,  \'z,     8\'h0); \n                                                                                                  ^~~~~~~~~\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:59: Define or directive not defined: \'`INSTRUCTION\'\n        `INSTRUCTION(icount,    A,      porta,    rega,   rega,   A,      `SET_FLAGS, `CM_STD,    `NA_AMODE,  \'z,     8\'h0); \n        ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:59: syntax error, unexpected \',\'\n        `INSTRUCTION(icount,    A,      porta,    rega,   rega,   A,      `SET_FLAGS, `CM_STD,    `NA_AMODE,  \'z,     8\'h0); \n                           ^\n%Error: data/full_repos/permissive/200314387/verilog/cpu/prog_hardware_registers.v:59: Define or directive not defined: \'`SET_FLAGS\'\n        `INSTRUCTION(icount,    A,      porta,    rega,   rega,   A,      `SET_FLAGS, `CM_STD,    `NA_AMODE,  \'z,     8\'h0); \n                                                                          ^~~~~~~~~~\n%Error: Exiting due to too many errors encountered; --error-limit=50\n'
module test();

    import alu_ops::*;

   `include "../lib/display_snippet.sv"

    logic clk=0;
    cpu CPU(1'b0, clk);





    localparam MAX_PC=100;
    `DEFINE_CODE_VARS(MAX_PC)


    logic [47:0] data =0;
    int addr;
    string rom1 = "roms/pattern1.rom";
    string rom2 = "roms/pattern2.rom";
    string rom3 = "roms/pattern3.rom";
    string rom4 = "roms/pattern4.rom";
    string rom5 = "roms/pattern5.rom";
    string rom6 = "roms/pattern6.rom";
    int n_file1;
    int n_file2;
    int n_file3;
    int n_file4;
    int n_file5;
    int n_file6;

    integer icount=0;

    initial begin

        icount=0;

        `INSTRUCTION(icount,    B,      rega,     rega,   immed,  A,      `SET_FLAGS, `CM_STD,    `NA_AMODE,  'z,     8'h11); 
        `INSTRUCTION(icount,    B,      regb,     regb,   immed,  A,      `KEEP_FLAGS,`CM_STD,    `NA_AMODE,  'z,     8'h22); 
        `INSTRUCTION(icount,    B,      regc,     regc,   immed,  A,      `SET_FLAGS, `CM_STD,    `NA_AMODE,  'z,     8'h33); 
        `INSTRUCTION(icount,    B,      regd,     regd,   immed,  A,      `KEEP_FLAGS,`CM_STD,    `NA_AMODE,  'z,     8'h44); 
        `INSTRUCTION(icount,    B,      porta,    rega,   rega,   A,      `SET_FLAGS, `CM_STD,    `NA_AMODE,  'z,     8'h0); 
        `INSTRUCTION(icount,    B,      porta,    regb,   regb,   A,      `KEEP_FLAGS,`CM_STD,    `NA_AMODE,  'z,     8'h0); 
        `INSTRUCTION(icount,    B,      porta,    regc,   regc,   A,      `SET_FLAGS, `CM_STD,    `NA_AMODE,  'z,     8'h0); 
        `INSTRUCTION(icount,    B,      porta,    regd,   regd,   A,      `KEEP_FLAGS,`CM_STD,    `NA_AMODE,  'z,     8'h0); 
        `INSTRUCTION(icount,    A,      porta,    rega,   rega,   A,      `SET_FLAGS, `CM_STD,    `NA_AMODE,  'z,     8'h0); 
        `INSTRUCTION(icount,    A,      porta,    regb,   regb,   A,      `KEEP_FLAGS,`CM_STD,    `NA_AMODE,  'z,     8'h0); 
        `INSTRUCTION(icount,    A,      porta,    regc,   regc,   A,      `SET_FLAGS, `CM_STD,    `NA_AMODE,  'z,     8'h0); 
        `INSTRUCTION(icount,    A,      porta,    regd,   regd,   A,      `KEEP_FLAGS,`CM_STD,    `NA_AMODE,  'z,     8'h0); 
        `JMP_IMMED16(icount,    0); 


        n_file1 = $fopen(rom1, "wb");
        n_file2 = $fopen(rom2, "wb");
        n_file3 = $fopen(rom3, "wb");
        n_file4 = $fopen(rom4, "wb");
        n_file5 = $fopen(rom5, "wb");
        n_file6 = $fopen(rom6, "wb");

        for (addr=0; addr < icount; addr++) begin
            $display("CODE : %-s" , CODE_NUM[addr]);


            data = `ROM(addr);
            #1000

            $fwrite(n_file1, "%c", data[7:0]);
            $fwrite(n_file2, "%c", data[15:8]);
            $fwrite(n_file3, "%c", data[23:16]);
            $fwrite(n_file4, "%c", data[31:24]);
            $fwrite(n_file5, "%c", data[39:32]);
            $fwrite(n_file6, "%c", data[47:40]);

            $display("written %d", addr, " = %8b %8b %8b %8b %8b %8b", 
                data[47:40],
                data[39:32],
                data[31:24],
                data[23:16],
                data[15:8],
                data[7:0],
                );
            end    
        $fclose(n_file1);
        $fclose(n_file2);
        $fclose(n_file3);
        $fclose(n_file4);
        $fclose(n_file5);
        $fclose(n_file6);

        $display("DONE");
        $finish();
    end

endmodule
module test();


    import alu_ops::*;

   `include "../lib/display_snippet.sv"

    logic clk=0;
    cpu CPU(1'b0, clk);





    localparam MAX_PC=100;
    `DEFINE_CODE_VARS(MAX_PC)


    logic [47:0] data =0;
    int addr;
    string rom1 = "roms/pattern1.rom";
    string rom2 = "roms/pattern2.rom";
    string rom3 = "roms/pattern3.rom";
    string rom4 = "roms/pattern4.rom";
    string rom5 = "roms/pattern5.rom";
    string rom6 = "roms/pattern6.rom";
    int n_file1;
    int n_file2;
    int n_file3;
    int n_file4;
    int n_file5;
    int n_file6;

    integer icount=0;

    initial begin

        icount=0;

        `INSTRUCTION(icount,    B,      rega,     rega,   immed,  A,      `SET_FLAGS, `CM_STD,    `NA_AMODE,  'z,     8'h11); 
        `INSTRUCTION(icount,    B,      regb,     regb,   immed,  A,      `KEEP_FLAGS,`CM_STD,    `NA_AMODE,  'z,     8'h22); 
        `INSTRUCTION(icount,    B,      regc,     regc,   immed,  A,      `SET_FLAGS, `CM_STD,    `NA_AMODE,  'z,     8'h33); 
        `INSTRUCTION(icount,    B,      regd,     regd,   immed,  A,      `KEEP_FLAGS,`CM_STD,    `NA_AMODE,  'z,     8'h44); 
        `INSTRUCTION(icount,    B,      porta,    rega,   rega,   A,      `SET_FLAGS, `CM_STD,    `NA_AMODE,  'z,     8'h0); 
        `INSTRUCTION(icount,    B,      porta,    regb,   regb,   A,      `KEEP_FLAGS,`CM_STD,    `NA_AMODE,  'z,     8'h0); 
        `INSTRUCTION(icount,    B,      porta,    regc,   regc,   A,      `SET_FLAGS, `CM_STD,    `NA_AMODE,  'z,     8'h0); 
        `INSTRUCTION(icount,    B,      porta,    regd,   regd,   A,      `KEEP_FLAGS,`CM_STD,    `NA_AMODE,  'z,     8'h0); 
        `INSTRUCTION(icount,    A,      porta,    rega,   rega,   A,      `SET_FLAGS, `CM_STD,    `NA_AMODE,  'z,     8'h0); 
        `INSTRUCTION(icount,    A,      porta,    regb,   regb,   A,      `KEEP_FLAGS,`CM_STD,    `NA_AMODE,  'z,     8'h0); 
        `INSTRUCTION(icount,    A,      porta,    regc,   regc,   A,      `SET_FLAGS, `CM_STD,    `NA_AMODE,  'z,     8'h0); 
        `INSTRUCTION(icount,    A,      porta,    regd,   regd,   A,      `KEEP_FLAGS,`CM_STD,    `NA_AMODE,  'z,     8'h0); 
        `JMP_IMMED16(icount,    0); 


        n_file1 = $fopen(rom1, "wb");
        n_file2 = $fopen(rom2, "wb");
        n_file3 = $fopen(rom3, "wb");
        n_file4 = $fopen(rom4, "wb");
        n_file5 = $fopen(rom5, "wb");
        n_file6 = $fopen(rom6, "wb");

        for (addr=0; addr < icount; addr++) begin
            $display("CODE : %-s" , CODE_NUM[addr]);


            data = `ROM(addr);
            #1000

            $fwrite(n_file1, "%c", data[7:0]);
            $fwrite(n_file2, "%c", data[15:8]);
            $fwrite(n_file3, "%c", data[23:16]);
            $fwrite(n_file4, "%c", data[31:24]);
            $fwrite(n_file5, "%c", data[39:32]);
            $fwrite(n_file6, "%c", data[47:40]);

            $display("written %d", addr, " = %8b %8b %8b %8b %8b %8b", 
                data[47:40],
                data[39:32],
                data[31:24],
                data[23:16],
                data[15:8],
                data[7:0],
                );
            end    
        $fclose(n_file1);
        $fclose(n_file2);
        $fclose(n_file3);
        $fclose(n_file4);
        $fclose(n_file5);
        $fclose(n_file6);

        $display("DONE");
        $finish();
    end

endmodule