1 |
2 |
sybreon |
================================================================================
|
2 |
|
|
COPYRIGHT
|
3 |
|
|
================================================================================
|
4 |
|
|
|
5 |
|
|
Copyright (C) 2006 Shawn Tan Ser Ngiap .
|
6 |
|
|
Permission is granted to copy, distribute and/or modify this document
|
7 |
|
|
under the terms of the GNU Free Documentation License, Version 1.2
|
8 |
|
|
or any later version published by the Free Software Foundation;
|
9 |
|
|
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
|
10 |
|
|
A copy of the license is included in the section entitled "GNU
|
11 |
|
|
Free Documentation License".
|
12 |
|
|
|
13 |
|
|
================================================================================
|
14 |
|
|
INTRODUCTION
|
15 |
|
|
================================================================================
|
16 |
|
|
|
17 |
|
|
The AE18 is a clean room implementation of a PIC18 software compatible core.
|
18 |
|
|
It is developed using publicly available documentation and tools. It is not
|
19 |
|
|
architecturally compatible. Major differences are noted in the section below.
|
20 |
|
|
|
21 |
|
|
================================================================================
|
22 |
|
|
NON-STANDARD FEATURES
|
23 |
|
|
================================================================================
|
24 |
|
|
|
25 |
|
|
There are some things that are implemented in a non standard way from the
|
26 |
|
|
PIC18. These are mainly minor issues that should not affect normal software
|
27 |
|
|
implementations. However, in certain cases, some software might need to be
|
28 |
|
|
modified to ensure correct operation.
|
29 |
|
|
|
30 |
|
|
1) Watch Dog Timer
|
31 |
|
|
|
32 |
|
|
The WDT is enabled by default. As there is no way to set any config bits for
|
33 |
|
|
this core, the ONLY way to disable it is by clearing the SWDTEN bit in the
|
34 |
|
|
WDTCON register.
|
35 |
|
|
|
36 |
|
|
2) Other Timers
|
37 |
|
|
|
38 |
|
|
The other timers found standard on a PIC18 are NOT included with the AE18
|
39 |
|
|
core. These timers can all be built as external peripherals and attached to
|
40 |
|
|
the data bus of the AE18.
|
41 |
|
|
|
42 |
|
|
3) Other Peripherals
|
43 |
|
|
|
44 |
|
|
The AE18 core DOES NOT include any I/O devices or peripherals with the core.
|
45 |
|
|
However, it is WISHBONE compliant and can be included in a larger SoC with
|
46 |
|
|
suitable I/O devices and peripherals included.
|
47 |
|
|
|
48 |
|
|
4) External Interrupts
|
49 |
|
|
|
50 |
|
|
The AE18 has the built in facility to handle external interrupts. However,
|
51 |
|
|
the interrupt controller is not included in the core and will need to be
|
52 |
|
|
attached to the data bus as an external device.
|
53 |
|
|
|
54 |
|
|
The INT_I[1:0] and INTE_I[1:0] inputs are used to indicate high/low interrupt
|
55 |
|
|
sources and enables. The external interrupts are all positive edge triggered.
|
56 |
|
|
On an interrupt, the PC will branch directly to the correct vectors.
|
57 |
|
|
|
58 |
|
|
================================================================================
|
59 |
|
|
NON-IMPLEMENTED FEATURES
|
60 |
|
|
================================================================================
|
61 |
|
|
|
62 |
|
|
There are a few PIC18 features that are non implemented. These include some
|
63 |
|
|
SFR and some architectural features. These need to be carefully noted as
|
64 |
|
|
they will require some minor software changes to ensure correct operation.
|
65 |
|
|
|
66 |
|
|
1) SFR Non Implemented
|
67 |
|
|
|
68 |
|
|
Some SFR are not implemented. Any attempt to read/write these SFR will not
|
69 |
|
|
work correctly. These SFR should not be accessed at all.
|
70 |
|
|
|
71 |
|
|
a) RCON
|
72 |
|
|
Does not make sense as the only source of reset is EXTERNAL/WDT/RESET.
|
73 |
|
|
b) OSCCON/LVDCON
|
74 |
|
|
Does not include a simple way to implement these features in an FPGA.
|
75 |
|
|
c) INTCON,INTCON2,INTCON3
|
76 |
|
|
Not implemented as it depends on external devices.
|
77 |
|
|
d) ALL peripheral registers
|
78 |
|
|
These will need to be implemented in each external device.
|
79 |
|
|
|
80 |
|
|
2) Important Notes
|
81 |
|
|
|
82 |
|
|
a) SLEEP
|
83 |
|
|
This instruction should always be followed by two NOP instructions.
|
84 |
|
|
b) DAW
|
85 |
|
|
This instruction has not been implemented yet.
|
86 |
|
|
c) ACCESS BANK
|
87 |
|
|
The data memory space for SFR has been moved to 0xFF80 and above.
|
88 |
|
|
|
89 |
|
|
================================================================================
|
90 |
|
|
USAGE
|
91 |
|
|
================================================================================
|
92 |
|
|
|
93 |
|
|
Some software and scripts have been included with the core. These are to assist
|
94 |
|
|
in the simulation and verification of the AE18.
|
95 |
|
|
|
96 |
|
|
1) Simulation
|
97 |
|
|
|
98 |
|
|
For the purpose of software simulation, the core has been extensively tested
|
99 |
|
|
using sample test software. The test software is included in the /sw directory.
|
100 |
|
|
The assembly file is compiled using GPASM 0.13.4. The resulting code has been
|
101 |
|
|
simulated using Icarus Verilog 0.8.2 and GPLCVER 2.11a.
|
102 |
|
|
|
103 |
|
|
Sample simulation scripts have been included for both cver and iverilog. These
|
104 |
|
|
scripts are located in the /sim directory. When running the included testbench
|
105 |
|
|
software (ae18_core.asm), the core should echo "Test response OK!" if it
|
106 |
|
|
passed all the tests in the software.
|
107 |
|
|
|
108 |
|
|
2) Implementation
|
109 |
|
|
|
110 |
|
|
The specifics of implementation will depend on the toolset used by the vendor.
|
111 |
|
|
However, the main point to note is memory implementation. The instruction
|
112 |
|
|
memory can be implemented as either on-chip or external memory.
|
113 |
|
|
|
114 |
|
|
================================================================================
|
115 |
|
|
FINAL NOTES
|
116 |
|
|
================================================================================
|
117 |
|
|
|
118 |
|
|
Although every care has been taken to test the core, there is no guarantee that
|
119 |
|
|
the AE18 core is compatible with the PIC18. If you wish to use this core in
|
120 |
|
|
production, please test the application thoroughly first.
|
121 |
|
|
|
122 |
|
|
1) TODO
|
123 |
|
|
|
124 |
|
|
- Tidy up the code and split it into manageable chunks.
|
125 |
|
|
- Optimise many of the parts (mainly PC and EA calculators).
|
126 |
|
|
|
127 |
|
|
================================================================================
|
128 |
|
|
CONTACT INFORMATION
|
129 |
|
|
================================================================================
|
130 |
|
|
|
131 |
|
|
Author : Shawn Tan
|
132 |
|
|
Email : shawn.tan@aeste.net
|
133 |
|
|
Website : www.aeste.net
|
134 |
|
|
|
135 |
|
|
Please do not hesitate to contact me if you use this core in any of your
|
136 |
|
|
applications.
|