📄 synthesizeable vhdl model of 8051.htm
字号:
strategy has been to write programs (C), compile them into Intel 8051 binaries
(HEX), convert these into ROM models (VHDL), then, simulate and observe the
behavior
<H2>All Instructions</H2><A
href="http://www.cs.ucr.edu/~dalton/i8051/i8051syn/source/test/testall.c">testall.c</A><BR><A
href="http://www.cs.ucr.edu/~dalton/i8051/i8051syn/source/test/testall.hex">testall.hex</A>
<P>This program will test all instructions except ACALL, LCALL, RET, RETI, and
MOVX(1-4). Each instruction is tested at a very rudimentary level ( 1 - 3 tests
per instruction). If applicable, the carry flag is also tested. If any
instruction fails, the program will output the instruction number to P1 and then
stop. Otherwise, 127 will be output to P1 when all instructions have passed.<BR>
<P>Each instruction's test is separated within the program to facilitate easy
expansion if desired. The on-chip RAM and the PSW are cleared before each
instruction is tested.<BR>
<P>The program uses the ASM directive to write source text into the .SRC file
similar to in-line assembly. Therefore, to create the HEX file using the KEIL
compiler, the steps are:<BR>
<UL>
<LI><B>c51 testall.c src</B><BR>
<LI><B>a51 testall.src</B><BR>
<LI><B>bl51 testall.obj to <I>outfile</I></B><BR>
<LI><B>oh51 <I>outfile</I></B><BR></LI></UL>
<P>To use the HEX file follow the instructions provided in the help pages
referenced at the bottom of this page.<BR>
<H2>Additional Test Files</H2>These are some additional test files that may be
useful for testing the 8051. Take a look at this <A
href="http://www.cs.ucr.edu/~dalton/i8051/i8051syn/ifrtbl.html">table</A> to get
a feel for how well these test programs stress the 8051!
<TABLE border=5 width="100%">
<TBODY>
<TR>
<TD>
<CENTER><B>C</B></CENTER></TD>
<TD>
<CENTER><B>HEX</B></CENTER></TD>
<TD>
<CENTER><B>Size (byte)</B></CENTER></TD>
<TD>
<CENTER><B>Simulation Time (ns)</B></CENTER></TD>
<TD>
<CENTER><B>Signal Trace</B></CENTER></TD></TR>
<TR>
<TD><A
href="http://www.cs.ucr.edu/~dalton/i8051/i8051syn/source/test/negcnt.c">negcnt.c</A></TD>
<TD><A
href="http://www.cs.ucr.edu/~dalton/i8051/i8051syn/source/test/negcnt.hex">negcnt.hex</A></TD>
<TD>
<DIV align=right>39</DIV></TD>
<TD>
<DIV align=right>270,000</DIV></TD>
<TD>P0 = 64, 65, 66, 67, 68, 69, 70, 71, 72, 73</TD></TR>
<TR>
<TD><A
href="http://www.cs.ucr.edu/~dalton/i8051/i8051syn/source/test/gcd.c">gcd.c</A></TD>
<TD><A
href="http://www.cs.ucr.edu/~dalton/i8051/i8051syn/source/test/gcd.hex">gcd.hex</A></TD>
<TD>
<DIV align=right>51</DIV></TD>
<TD>
<DIV align=right>327,000</DIV></TD>
<TD>P0 = 36, 25, 14, 3, 1</TD></TR>
<TR>
<TD><A
href="http://www.cs.ucr.edu/~dalton/i8051/i8051syn/source/test/int2bin.c">int2bin.c</A></TD>
<TD><A
href="http://www.cs.ucr.edu/~dalton/i8051/i8051syn/source/test/int2bin.hex">int2bin.hex</A></TD>
<TD>
<DIV align=right>60</DIV></TD>
<TD>
<DIV align=right>500,000</DIV></TD>
<TD>P0 = 0, 1, 0, 1, 0, 1, 0, 1</TD></TR>
<TR>
<TD><A
href="http://www.cs.ucr.edu/~dalton/i8051/i8051syn/source/test/cast.c">cast.c</A></TD>
<TD><A
href="http://www.cs.ucr.edu/~dalton/i8051/i8051syn/source/test/cast.hex">cast.hex</A></TD>
<TD>
<DIV align=right>127</DIV></TD>
<TD>
<DIV align=right>870,000</DIV></TD>
<TD>P0 = 01H, P1 = 23H, P2 = 45H, P3 = 67H</TD></TR>
<TR>
<TD><A
href="http://www.cs.ucr.edu/~dalton/i8051/i8051syn/source/test/divmul.c">divmul.c</A></TD>
<TD><A
href="http://www.cs.ucr.edu/~dalton/i8051/i8051syn/source/test/divmul.hex">divmul.hex</A></TD>
<TD>
<DIV align=right>210</DIV></TD>
<TD>
<DIV align=right>370,000</DIV></TD>
<TD>P0 = 10, 4, 134</TD></TR>
<TR>
<TD><A
href="http://www.cs.ucr.edu/~dalton/i8051/i8051syn/source/test/fib.c">fib.c</A></TD>
<TD><A
href="http://www.cs.ucr.edu/~dalton/i8051/i8051syn/source/test/fib.hex">fib.hex</A></TD>
<TD>
<DIV align=right>305</DIV></TD>
<TD>
<DIV align=right>1,042,000</DIV></TD>
<TD>P0 = 1, 1, 2, 3, 5, 8, 13, 21, 34, 55</TD></TR>
<TR>
<TD><A
href="http://www.cs.ucr.edu/~dalton/i8051/i8051syn/source/test/sort.c">sort.c</A></TD>
<TD><A
href="http://www.cs.ucr.edu/~dalton/i8051/i8051syn/source/test/sort.hex">sort.hex</A></TD>
<TD>
<DIV align=right>544</DIV></TD>
<TD>
<DIV align=right>3,600,000</DIV></TD>
<TD>P0 = 0, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19</TD></TR>
<TR>
<TD><A
href="http://www.cs.ucr.edu/~dalton/i8051/i8051syn/source/test/sqroot.c">sqroot.c</A></TD>
<TD><A
href="http://www.cs.ucr.edu/~dalton/i8051/i8051syn/source/test/sqroot.hex">sqroot.hex</A></TD>
<TD>
<DIV align=right>1121</DIV></TD>
<TD>
<DIV align=right>4,000,000</DIV></TD>
<TD>P0 = 9, P1 = 16, P2 = 25, P3 = 5</TD></TR>
<TR>
<TD><A
href="http://www.cs.ucr.edu/~dalton/i8051/i8051syn/source/test/xram.c">xram.c</A></TD>
<TD><A
href="http://www.cs.ucr.edu/~dalton/i8051/i8051syn/source/test/xram.hex">xram.hex</A></TD>
<TD>
<DIV align=right>67</DIV></TD>
<TD>
<DIV align=right>37,000,000</DIV></TD>
<TD>/I8051_XRM/XRAM(...) = 1, 2, 3, 4, ... </TD></TR></TBODY></TABLE>
<H1>Complete Source Code Archive</H1>Here is were you'll find the latest (as
well as older to oldest) source code in tared/gziped format.
<TABLE border=5 width="100%">
<TBODY>
<TR>
<TD>
<CENTER><B>Archive</B></CENTER></TD>
<TD>
<CENTER><B>Version</B></CENTER></TD>
<TD>
<CENTER><B>Date</B></CENTER></TD>
<TD>
<CENTER><B>Notes</B></CENTER></TD></TR>
<TR>
<TD><A
href="http://www.cs.ucr.edu/~dalton/i8051/i8051syn/archive/source_2.9.tar.gz">source_2.9.tar.gz</A></TD>
<TD>
<DIV align=right>2.9</DIV></TD>
<TD>2/20/2001</TD>
<TD>Fixed a harmless warning when compiling i8051_mkr.c.</TD></TR>
<TR>
<TD><A
href="http://www.cs.ucr.edu/~dalton/i8051/i8051syn/archive/source_2.8.tar.gz">source_2.8.tar.gz</A></TD>
<TD>
<DIV align=right>2.8</DIV></TD>
<TD>1/22/2001</TD>
<TD>Fixed a problem with the DJNZ_2 instruction. When a jump was made,
changing the resulting upper 8-bits of the PC value, the instruction would
incorrectly update PC. (Many thanks to Greg Stitt for finding the
bug.)</TD></TR>
<TR>
<TD><A
href="http://www.cs.ucr.edu/~dalton/i8051/i8051syn/archive/source_2.7.tar.gz">source_2.7.tar.gz</A></TD>
<TD>
<DIV align=right>2.7</DIV></TD>
<TD>11/16/2000</TD>
<TD>Implemented external memory functionality. Added a model of SRAM. The
testbench now connects an 8051 core with 2048 bytes of external memory
that can be read/written via the MOVX instructions.</TD></TR>
<TR>
<TD><A
href="http://www.cs.ucr.edu/~dalton/i8051/i8051syn/archive/source_2.6.tar.gz">source_2.6.tar.gz</A></TD>
<TD>
<DIV align=right>2.6</DIV></TD>
<TD>08/01/2000</TD>
<TD>Fixed a problem with INC_4 and DEC_4 instructions. (Many thanks to
Shu-Yi Yu for letting us know about the problem and sending us some very
helpful test code.)</TD></TR>
<TR>
<TD><A
href="http://www.cs.ucr.edu/~dalton/i8051/i8051syn/archive/source_2.5.tar.gz">source_2.5.tar.gz</A></TD>
<TD>
<DIV align=right>2.5</DIV></TD>
<TD>07/14/2000</TD>
<TD>Added comments to the port signals used in this implementation.</TD></TR>
<TR>
<TD><A
href="http://www.cs.ucr.edu/~dalton/i8051/i8051syn/archive/source_2.4.tar.gz">source_2.4.tar.gz</A></TD>
<TD>
<DIV align=right>2.4</DIV></TD>
<TD>11/23/1999</TD>
<TD>Fixed a bug in i8051_mkr.c that caused it to fail when non keil
compiled hex files were being loaded. (Many thanks to Lars Wehmeyer who
found and fixed the error and then sent us a patch.)</TD></TR>
<TR>
<TD><A
href="http://www.cs.ucr.edu/~dalton/i8051/i8051syn/archive/source_2.3.tar.gz">source_2.3.tar.gz</A></TD>
<TD>
<DIV align=right>2.3</DIV></TD>
<TD>11/19/1999</TD>
<TD>Converted the i8051_mkr.cc file to i8051_mkr.c, i.e., a pure C file
for greater portability. Fixed a bug in the I8051_ALU entity, more
specifically, the divider unit. Removed the reference to I8051_LIB in the
testbench (not needed there).</TD></TR>
<TR>
<TD><A
href="http://www.cs.ucr.edu/~dalton/i8051/i8051syn/archive/source_2.2.tar.gz">source_2.2.tar.gz</A></TD>
<TD>
<DIV align=right>2.2</DIV></TD>
<TD>9/15/1999</TD>
<TD>Fixed a harmless warning when compiling i8051_mkr.cc. For consistency
with the material on this page, made sort.hex the default program in
i8051_rom.vhd.</TD></TR>
<TR>
<TD><A
href="http://www.cs.ucr.edu/~dalton/i8051/i8051syn/archive/source_2.1.tar.gz">source_2.1.tar.gz</A></TD>
<TD>
<DIV align=right>2.1</DIV></TD>
<TD>8/15/1999</TD>
<TD>First released version.</TD></TR></TBODY></TABLE>
<H1>Help Using Synopsys Design Compiler & Related Tools</H1>
<UL>
<LI><A
href="http://www.cs.ucr.edu/~dalton/i8051/i8051syn/helpsim.html">Simulation</A>
<LI><A
href="http://www.cs.ucr.edu/~dalton/i8051/i8051syn/helpsyn.html">Synthesis</A>
</LI></UL>
<HR>
<IMG src="Synthesizeable VHDL Model of 8051.files/counter.gif"><BR><I>Last
Updated 2/20/2001</I> </BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -