Giter Club home page Giter Club logo

microcorelabs / projects Goto Github PK

View Code? Open in Web Editor NEW
386.0 36.0 78.0 1.24 GB

Ted Fried's MicroCore Labs Projects which include microsequencer-based FPGA cores and emulators for the 8088, 8086, 8051, 6502, 68000, Z80, Risc-V, and also Typewriter and EPROM Emulator projects. MCL51, MCL64, MCL65, MCL65+, MCL68, MCL86, MCL86+, MCL86jr, MCLR5, MCLZ8, MCL6809

Verilog 4.17% Batchfile 0.27% Assembly 7.54% C 0.56% C++ 83.17% HTML 2.60% VHDL 0.51% Shell 0.47% Tcl 0.49% Stata 0.18% SystemVerilog 0.05% XSLT 0.01%
6502 68000 8051 8051-microcontroller 8086 8088 pcjr risc-v z80 z80-emulator

projects's Introduction

Ted Fried's MicroCore Labs Projects

My blog which has some details on these projects: www.MicroCoreLabs.Wordpress.com

My YouTube Channel with some videos of the stuff in action: www.youtube.com/channel/UC9B3TaEUon-araO2j7tp9jg/videos

Boards:

MCL6809  -  Motorola 6809E emulator which runs on a Teensy 4.1 and can be used as a drop-in replacment 
MCLZ8    -  Zilog Z80 emulator which runs on a Teensy 4.1 and can be used as a drop-in replacment 
MCL86+   -  Intel 8088 emulator which runs on a Teensy 4.1 and can be used as a drop-in replacment 
MCL86jr  -  IBMPCjr Accelerator which boosts performance to IBM PC/AT speed
MCL65+   -  MOS 6502 emulator which runs on a Teensy 4.1 and can be used as a 6502 drop-in replacment
MCL64    -  MOS 6510 emulator which runs on a Teensy 4.1 and can be used as a drop-in replacment in the Commodore 64
MCL68+   -  Motorola 68000 emulator which runs on a Teensy 4.1 and can be used as a drop-in replacment 

Emulated Processors:

MCL68  - Motorola 68000 Emulator written in C
RISCV  - Simple and compact RISC-V RS32I implementation written in C
MCL65  - MOS 6502 written in C

Microsequencer-based processors:

MCL65 - MOS 6502 
MCL51 - Intel 8051
MCL86 - Intel 8086/8088

Other processors:

MCLR5 - Quad-Issue Superscalar RISCV
Lockstep Quad Modular Redundant System 

Misc:

Wheelwriter  - FPGA based Printer Option for the IBM Wheelwriter 5
Wheelwriter2 - Arduino Leonardo based Printer Option for the IBM Wheelwriter 5
Brother Typewriter - Arduino Leonardo converts Serial RX to a Brother Word Processor
EPROM Emulator - Small PCB which uses Teensy 4.0 to emulate up a 64KB 27C512 EPROM
MCL64_Tester - Extensive, menu-based, tests for the Commodore 64 motherboard
MCLZ8 TRS-80 Emulator - Emulates a TRS-80 Model 1 inside of a Teensy microcontroller board
MCL_TRS_NABU - Emulates a TRS-80 Model 1 using the MCLZ8 which runs inside of a NABU Personal Computer
Turbo NABU - Uses the MCLZ8 to run simple C code on the Teensy to control the motherboard resources of the NABU Computer
MDA Video - Project which uses an Arty Z7-20 SOC FPGA board to diaplay BMP images to an MDA display
IBMPC_68000 - Uses the MCL86+ board to emulate a Motorola 68000 which runs inside of an IBM PC as-if they selected this processor in 1981
MCL65_Apple1 - Converts an Apple II into an Appke 1 by emulating the BIOS PROMs, system memory, and performing some I/O conversion
XTMax - 8-bit ISA card containing a Teensy 4.1 which can emulate RAM, ROM, and peripherals

For questions email me at www.MicroCoreLabs.com

projects's People

Contributors

microcorelabs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

projects's Issues

M68K - Infinite loop in test all opcodes

I have an endless loop in this part of code

image

lines 3898-3916

ABCD_INNER1: move.l d6 , d1
andi.b #$EF , CCR * Clear X Flag
move.l #$00000110, a0 * Address pointer-X
move.l #$00000120, a1 * Address pointer-Y
move.b d0 , -1(a0)
move.b d1 , -1(a1)
abcd d0 , d1
bcc ABCD_NO_C1 * Check C Flag bcc/bcs 0
add.l #1 , d4
ABCD_NO_C1: add.l d1 , d5
abcd -(a0) , -(a1)
bcc ABCD_NO_C2 * Check C Flag bcc/bcs 0
add.l #1 , d4
ABCD_NO_C2: add.b (a1) , d3
dbf d6 , ABCD_INNER1

Easy68k v5.16.1

MCLZ8 issue with halt?

Thanks for the great MCZL8 solution! I am having a lot of fun using it with my MSX.
It looks like the HALT instruction is not working as it should. When a HALT is issued, it gets repeating the halt instruction.
I think the 'register_pc--' should not be there?

`void opcode_0x76() { // Halt

digitalWriteFast(PIN_HALT,0x0);
halt_in_progress=1;
register_pc--;
return;

}
`

Tested this code in 'IM 1' mode. After a HALT is issued, an interrupt should resume the CPU but it does not.

`
ei // Enable interrupts
halt // Wait for interrupt
ret

`

Wheelwriter project, errors synthesizing

I get an error trying to synthesize mclwr1.v in Diamond 3.6 or 3.12:

documents/impl1/source/mclwr1.v(120): net rx_fifo_wr is constantly driven from multiple places at instance RX_FIFO, on port WrEn. VDB-1000
Done: error code 2

And programming directly from the JEDEC in the repo produces transmit checksum errors and results in a non-functional board.

40 pin dip breakout for MCL65 ?

Hi, did you buy or make the 40 pin dip breakout that you would connect the jumper wires with?
Just to be clear, this is the board that you inserted into the motherboard 40 pin dip sockets.

Bug in RISCV_C_Version?

The comparison operator for "BLTU" in riscv.c (l. 91) should be "<" instead of ">=" (this line is identical to the "BGE" line below it except for the instruction name):

if (opcode==0b1100011 && funct3==0b110) { if (rv5_reg[rs1]**>=**rv5_reg[rs2]) rv5_pc = ( (B_immediate_SE) + rv5_pc) - 0x4; printf(" BLTU "); } else // BLTU

MCLZ8 - Fetch_opcode() is wrongly used to retrieve immediate values, displacements or offsets in an instruction.

This function is called too often wrongly to retrieve immediate values, displacements or offsets in an instruction. You should use a MEM_READ_BYTE (3 T-states) and not an OPCODE_READ_M1 (4 T-states) for them!

uint8_t Fetch_opcode() {

There is no M1 = 0 and no refresh when retrieving immediate values, displacements or offsets in an instruction!

See here a complex example here: https://floooh.github.io/2021/12/06/z80-instruction-timing.html#dd-and-fd-prefixes. Be aware the table are showing steps per half-cycle (half T-state) so a MEM_READ_BYTE would be 6 rows for 3 T-states.

MCL64 - checking a good c64 report some errors on rams and kernal char rom

hi, MCL64 seems to be a great thing but i got some errors on checking a working c64 board (250407).
Before I started with MCL64 I was checking the hole hardware with my UfD Set (https://www.forum64.de/index.php?thread%2F127712-ufd-cartridge-dual-diagnose-cartridge-mit-spannungs-und-frequenzmessung%2F=&pageNo=1 which reports no error on the rams and roms.
After that I run some tests with my MCL64 the roms got a passed status.
mcl64 char rom test
mcl64 basic rom test
mcl64 kernal rom test

But a check of the DRAM fails
mcl64 dram test
Ans the initial test also reports failures inside the roms, which passes the single test before
mcl64 initial test

Is it possible to solve these errors?
I also think that all the different board releases out there (250407, 2050425,250466, 250469 and the older ones) maybe report other results. The most of them are in my collection so I can so some tests if you would be so glad to update the code.
happy hacking and kind regards
znarF54

MCL64 in cartridge form?

I'm mostly interested in the SuperCPU potential of the MCL64.
Today I just found out about the RAD cartridge project: puts a Raspberry Pi 3A/3B or Zero 2 on-board a cartridge and it supersedes the 6510.
What would it take to put the MCL64 onto a cartridge board?

Internal_RAM fixed to 256K for MCL86+?

Hi Ted,

Great work on all of these projects.

With the Teensy having 1024KB of RAM (albeit only 512KB tightly coupled) and with relatively mild RAM usage in the main accelerator, is there any reason we couldn't have Internal_RAM be 0x80000 or even 0xA0000? The latter would bust the tightly coupled RAM but should still fit?

Regards,

Greg

EPROM Emulator max size?

Hi, I just stumbled upon your eprom emulator project. It looks like at the moment the max size is 64KB (27C512). I have a project that needs 512KB (27C040). I wanted to see if it would be possible to scale this design up for that and if you had any recommendations to accomplish this?

Chip orientation? Black Screen.

I've soldered up one of these MCL64 boards, and am getting a black screen on power up on a 64. I programmed the Teensy successfully, and am certain there are no bridges (did the soldering under high magnification under a microscope). Triple checked my soldering, and used the mouser part numbers from the BOM.

The only thing I can think of is that somehow I haven't oriented the chips correctly as I don't see anything on the board that indicates where pin 1 should be. I assumed that the top of the chip, with the pin 1 dot, is towards the Ux designation for each chip.

If my chip orientation isn't an issue, I am otherwise at a loss as to why it doesn't work for me. Any suggestions on troubleshooting would be appreciated.

M68k - wrong MOVE from SR test

Using the MC68000_test_all_opcodes.X68 test rom, the MOVE from SR test does

move #$275A, SR        * Initial value
move SR , d0
cmpi.w #$275A , d0

But from the M68000RPM, on the MOVE from SR instruction

Unimplemented bits are read as zeros.

Since the bit 6 of the SR is unimplemented, the test should compare with $271A instead.

Also this has been proved to be wrong on an actual hardware (Philips CD-i, having a 68000-based CPU) :
alt text

About the other instructions that fails on hardware, we are not sure yet why they fails.

About the screenshot : your test ROM has been modified so that when a test fails, instead of doing an infinite loop, it prints the name of the test that fails on the serial port of the console, and continues with the next tests.

ZEXALL on a Z80 machine - CRC errors

I used the zexall from: https://github.com/anotherlin/z80emu/blob/master/testfiles/zexall.z80!

To do so, I tweaked the firmware so it can run on my SHARP MZ-80 K this way:

  1. Mode 3 for RAM to speed up ZEXALL execution as it may be quite slow on a 2MHz machine,
  2. Virtual RAM from $0000 to $CFFF since ZEXALL starts from $0100,
  3. I/O memory from $D000 to $FFFF is kept but never used,
  4. IN A,(n) is tweaked to output a string to Serial USB terminal,
  5. OUT (n),A is tweaked to issue a HALT forever (interrupts are ignored),
  6. $0000 and $0005 are also tweaked to issue OUT and IN.

So when booting the machine, here is what I get:

image

[MCL65+] Lack of address bus voltage convertersion

According to Teensy 4.1 specs all pins are not 5V tolerant. I have noticed that only data bus is buffered between 5V and 3.3V with two 74LVC573 latches. Address bus is connected directly which means 5V signals will reach Teensy inputs and can theoretically damage it. Moreover I have found that MCL64 version intended for Commodore C64 has buffers for both data and address bus. Could you please explain this?

MCLZ8 - Some opcodes should take 5 cycles (for instance, DJNZ) and not only 4 cycles in M-cycle M1

void opcode_0x10() { register_b--; if (register_b != 0) {clock_counter=clock_counter+5; Jump_Taken8();} else Jump_Not_Taken8(); return; } // djnz * - Disp8

The memory access to the byte for displacement jump (or not) is taken one T-state too early compared to a genuine Z80. For Z80 machines which are very sensitive to /WAIT pattern (e.g: AMSTRAD CPC), it may alter the whole timing and so the behavior of the CPC program counting very much about the cycle accuracy regarding the memory access.

That extra T-state at the end of M1 M-cycle is due to an internal "dec b". In mode 0, the MEMORY READ M-cycle for memory access to displacement byte should happen 5 CLK cycles after M1 M-cycle, not the usual 4 CLK cycles.

See DJNZ: https://www.manualsdir.com/manuals/753749/zilog-z08470.html?page=287

It is not the only instruction to have extra T-states inserted in the middle of the whole instruction T-states.

ADC/SBC buggy?

Hi -

I am wondering if you have checked your (beautifully neat) 6502 implementation against a respected test such as Klaus2m5?

I ask because I have been testing my own emulation, and I have trouble with the notorious ADC/SBC opcodes. When I tried your implementations it also failed.

I see in your code the line:

if ((0x00FF&bcd_total) > 0x09) { bcd_total=bcd_total+0x010; bcd_total=bcd_total-0x0A; }

which contains a reference bcd_total before it has been assigned a value, thus the condition is never true. Maybe you missed something?

thanks!

-John

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.