Increased the accessible memory and got the Mandelbrot renderer working under the brainfuck compiler!
This commit is contained in:
parent
6ea34a3525
commit
6e8d951360
@ -242,4 +242,3 @@ bootup_msg: .ASCII 'Native brainfuck compiler v1\n'
|
||||
DATA: .BLKB 560
|
||||
.BLKB 200
|
||||
STACK:
|
||||
output_program: .BLKB 600
|
||||
|
@ -1,4 +1,4 @@
|
||||
INCLUDE brainfuck_interpreter_v0.asm
|
||||
INCLUDE brainfuck_compiler_v1.asm
|
||||
|
||||
prog:
|
||||
.ASCII '+++++++++++++[->++>>>+++++>++>+<<<<<<]>>>>>++++++>--->>>>>>>>>>+++++++++++++++[['
|
||||
@ -145,3 +145,5 @@ prog:
|
||||
.ASCII '>>>]>[-]+<]]+>[-<[>>>>>>>>>]<<<<<<<<]>>>>>>>>]<<<<<<<<<[<<<<<<<<<]>>>>[-]<<<++++'
|
||||
.ASCII '+[-[->>>>>>>>>+<<<<<<<<<]>>>>>>>>>]>>>>>->>>>>>>>>>>>>>>>>>>>>>>>>>>-<<<<<<[<<<<'
|
||||
.ASCII '<<<<<]]>>>]'
|
||||
|
||||
output_program:
|
||||
|
Binary file not shown.
@ -22,7 +22,7 @@ disas: $(subst .txt,.disas,${BOOT_CODE})
|
||||
|
||||
# Assembling code
|
||||
%.txt:%.bin
|
||||
${Q}dd if=/dev/zero bs=1 count=16384 of="$(subst .bin,.stage,$<)" status=none
|
||||
${Q}dd if=/dev/zero bs=1 count=32768 of="$(subst .bin,.stage,$<)" status=none
|
||||
${Q}dd if="$<" of="$(subst .bin,.stage,$<)" conv=notrunc,nocreat status=none
|
||||
${Q}xxd -ps -c 2 "$(subst .bin,.stage,$<)" > "$@"
|
||||
${Q}rm "$(subst .bin,.stage,$<)"
|
||||
|
@ -520,7 +520,7 @@ always @( CIR or SIMPLE_MICRO or seq_addr_input ) begin
|
||||
end
|
||||
11'b1111_1111_100:begin
|
||||
/* JMP - Unconditional indirect within segment jump */
|
||||
/* 1 1 1 1 1 1 1 1 | MOD 1 0 1 R/M | < DISP-LO > | < DISP-HI > */
|
||||
/* 1 1 1 1 1 1 1 1 | MOD 1 0 0 R/M | < DISP-LO > | < DISP-HI > */
|
||||
`start_aligning_instruction
|
||||
opcode_size=1;
|
||||
has_operands=0;
|
||||
|
@ -18,20 +18,20 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
module mem(input [19:0] address,inout wire [15:0] data ,input rd,input wr,input cs);
|
||||
reg [15:0] memory [0:8191];
|
||||
reg [15:0] memory [0:32768];
|
||||
initial begin
|
||||
string boot_code;
|
||||
if(!$value$plusargs("BOOT_CODE=%s",boot_code))begin
|
||||
$display("No boot code specified. Please add +BOOT_CODE=<path> to your vvp args");
|
||||
$finish;
|
||||
end
|
||||
$readmemh(boot_code, memory);
|
||||
$readmemh(boot_code, memory,0,16383);
|
||||
end
|
||||
|
||||
assign data = !rd & !cs ? memory[address[12:0]]: 16'hz;
|
||||
assign data = !rd & !cs ? memory[address[15:0]]: 16'hz;
|
||||
|
||||
always @(negedge wr) begin
|
||||
memory[address[12:0]]=data;
|
||||
memory[address[15:0]]=data;
|
||||
end
|
||||
|
||||
endmodule
|
||||
|
@ -56,7 +56,7 @@ end
|
||||
always @(posedge HALT) begin
|
||||
$display("Processor halted.\nCycles run for: %d",cycles);
|
||||
if($value$plusargs("MEMDUMP=%s",memdump_name))begin
|
||||
$writememh(memdump_name, sysmem.memory);
|
||||
$writememh(memdump_name, sysmem.memory,0,32767);
|
||||
end
|
||||
#(`CPU_SPEED) //Just for the waveform
|
||||
$finish;
|
||||
@ -66,7 +66,7 @@ always @(posedge ERROR) begin
|
||||
clk_enable <= 0;
|
||||
$display("PROCESSOR RUN INTO AN ERROR.\nCycles run for: %d",cycles);
|
||||
if($value$plusargs("MEMDUMP=%s",memdump_name))begin
|
||||
$writememh(memdump_name, sysmem.memory);
|
||||
$writememh(memdump_name, sysmem.memory,0,32767);
|
||||
end
|
||||
#(`CPU_SPEED) //Just for the waveform
|
||||
$finish;
|
||||
|
Loading…
Reference in New Issue
Block a user