Mera400f is a reimplementation of MERA-400 CPU in Verilog. It aims to be 100% true to the original on functional and signal level. The same signals run through the same functional blocks, yielding the same results. It does not try to redo the 74xx implementation, but rather reimplement the logical structure using current tools.
All names match those on original schematic, with the following cosmetic changes:
- all signal names are lowercase instead of uppercase,
- bus signals are grouped together (IR0..IR15 becomes ir[0:15]),
- additional named signals get the name
Mxx_yy
where x is the component number, y is the pin number from which the signal originates, - components and submodules get uppercase names (related to component function, in most cases),
- active-low signal names end with underscore,
- special characters treatment:
- special characters in the middle of the name are replaced with an underscore (eg.
W->LEGY
becomesw_legy
,-EKC*2
becomesekc_2_
), - star or atmark at the end of signal name is replaced with dollar sign (eg.
OK*
becomesok$
,-W&
becomesw$_
), - for complex names underscores are used as special characters replacements (eg.
I3/EX+PRZER/
becomesi3_ex_przer
,CK->RZ*W
becomesck_rz_w
),
- special characters in the middle of the name are replaced with an underscore (eg.
- signal names which start with a number are prefixed with an underscore (eg.
0->V
becomes_0_v
), - polish diacritics are replaced with non-diacritics,
In several cases schematic was wrong and Verilog implementation has been fixed to reflect the hardware. For all those cases appropriate comments were added in the code.
MERA-400 control panel is implemented as a simple serial protocol, running at 1Mbit 8N1 by default. It recognizes the following commands (each command is 8 bit long):
001 FFFF V
- Set function key FFFF (see below) to position V (0-off, 1-on)01 KKKKKK
- Set data keys 10-15 to binary value K100 KKKKK
- Set data keys 5-9 to binary value K101 KKKKK
- Set data keys 0-4 to binary value K110 xxxxx
- Read LED status. Sends back four bytes:- data leds 0-7
- data leds 8-15
- MODE, STOP*N, CLOCK, Q, P, MC, IRQ, RUN
- rotary switch position, 0, 0, WAIT, ALARM
111 xPPPP
- Set rotary switch to position PPPP (see below)
x
bits value doesn't matter.
Function keys (FFFF):
0000
- START0001
- MODE0010
- CLOCK0011
- STOP*N (momentary)0100
- STEP (momentary)0101
- FETCH (momentary)0110
- STORE (momentary)0111
- CYCLE (momentary)1000
- LOAD (momentary)1001
- BIN (momentary)1010
- OPRQ (momentary)1011
- CLEAR (momentary)
If a momentary switch is set to 1, it automaticaly bounces back, there is no need to explicitly set it back to 0.
Rotary switch positions (PPPP):
0000
- R00001
- R10010
- R20011
- R30100
- R40101
- R50110
- R60111
- R71000
- IC1001
- AC1010
- AR1011
- IR1100
- SR1101
- RZ1110
- KB1111
- KB