1 |
2 |
tarookumic |
(progn
|
2 |
|
|
(load "cdef_lib_b1")
|
3 |
|
|
(load "cdef_lib_c1")
|
4 |
|
|
(load "cdef_lib_g1")
|
5 |
|
|
(load "cdef_lib_l1")
|
6 |
|
|
(load "cdef_lib_m1")
|
7 |
|
|
(load "cdef_lib_i1")
|
8 |
|
|
(load "cdef_lib_h1")
|
9 |
|
|
(load "cdef_lib_pc")
|
10 |
|
|
(load "cdef_lib_pv")
|
11 |
|
|
)
|
12 |
|
|
|
13 |
|
|
(progn
|
14 |
|
|
(if (load "cdef_lib_b1") ()(message "You have to set your elisp load-path variable, i.e: (setq load-path
|
15 |
|
|
(append (list nil \"/home/eiselekd/vhdl_0.8/soft/cdef\") load-path)))"))
|
16 |
|
|
(load "cdef_lib_c1")
|
17 |
|
|
(load "cdef_lib_g1")
|
18 |
|
|
(load "cdef_lib_l1")
|
19 |
|
|
(load "cdef_lib_m1")
|
20 |
|
|
(load "cdef_lib_i1")
|
21 |
|
|
(load "cdef_lib_h1")
|
22 |
|
|
(load "cdef_lib_pc")
|
23 |
|
|
(load "cdef_lib_pv")
|
24 |
|
|
|
25 |
|
|
(setq insn-help '(
|
26 |
|
|
(c "Condition code")
|
27 |
|
|
(op1 "Data processing opcode")
|
28 |
|
|
(rn "Register rn")
|
29 |
|
|
(rm "Register rm")
|
30 |
|
|
(rs "Register rs")
|
31 |
|
|
(rdl "Destination register long")
|
32 |
|
|
(rd "Destination register rd")
|
33 |
|
|
(sha "Shieft amount")
|
34 |
|
|
(sh "Shieft direction")
|
35 |
|
|
(dps "Update cpsr")
|
36 |
|
|
(imm "Breakpoint imm part1")
|
37 |
|
|
(imm2 "Breakpoint imm part2")
|
38 |
|
|
|
39 |
|
|
(dsop "Dsp operand")
|
40 |
|
|
(MS "Set cpsr")
|
41 |
|
|
(MA "Multiply accumulate")
|
42 |
|
|
(MU "Multiply unsigned")
|
43 |
|
|
|
44 |
|
|
(SB "Swap byte")
|
45 |
|
|
(LSP "pre-indexed")
|
46 |
|
|
(LSU "add/sub base '1'=add")
|
47 |
|
|
(LSW "writeback")
|
48 |
|
|
(LSL "Load|Store '1'=Load")
|
49 |
|
|
(S "Signed|Unsigned '1'=signed")
|
50 |
|
|
(H "halfword|signedbyte '1'=halfword")
|
51 |
|
|
(i81 "Immidiate8 part1")
|
52 |
|
|
(i82 "Immidiate8 part2")
|
53 |
|
|
(dpi "Immidiate8")
|
54 |
|
|
(rot "Immidiate8 rotate")
|
55 |
|
|
(rgl "register list")
|
56 |
|
|
(R "Cpsr|Spsr '1'=Spsr")
|
57 |
|
|
(MSK "move immidiate to status register mask")
|
58 |
|
|
(LSB "Byte|word '1'=byte")
|
59 |
|
|
(LMS "Set cpsr fro spsr")
|
60 |
|
|
(BLL "Link")
|
61 |
|
|
(BLH "Exchange")
|
62 |
|
|
(Cp_N "Coprocessor n bit")
|
63 |
|
|
(cpn "Coprocessor number")
|
64 |
|
|
(crn "Coprocessor register rn")
|
65 |
|
|
(crm "Coprocessor register rm")
|
66 |
|
|
(of8 "offset8")
|
67 |
|
|
(crd "Coprocessor destination register")
|
68 |
|
|
(co1 "Coprocessor op1")
|
69 |
|
|
|
70 |
|
|
(insn_dp_i_s "Data Processing immidiate shieft")
|
71 |
|
|
|
72 |
|
|
(insn_msr "Move status register to register" )
|
73 |
|
|
(insn_mrs "Move register to status register" )
|
74 |
|
|
(insn_bex "Branch / exchange")
|
75 |
|
|
(insn_clz "Count leading zero")
|
76 |
|
|
(insn_blx "Branch and link /exchange")
|
77 |
|
|
(insn_dsa "Dsp add|sub")
|
78 |
|
|
(insn_brk "Breakpoint" )
|
79 |
|
|
(insn_dsm "DSP multiply")
|
80 |
|
|
|
81 |
|
|
(insn_dp_r_s "Data processing register shieft")
|
82 |
|
|
|
83 |
|
|
(insn_mula "Multiply and accumulate")
|
84 |
|
|
(insn_mull "Multiply long")
|
85 |
|
|
|
86 |
|
|
(insn_swp "Swap|swap byte")
|
87 |
|
|
|
88 |
|
|
(insn_ld1 "Load|Store halfword")
|
89 |
|
|
(insn_ld2 "Load|Store halfword immidiate offset")
|
90 |
|
|
(insn_ld3 "Load|Store two words register offset")
|
91 |
|
|
(insn_ld4 "Load|Store signed halfword/byte register offset")
|
92 |
|
|
(insn_ld5 "Load|Store two words register offset")
|
93 |
|
|
(insn_ld6 "Load|Store signed halfword/byte immidiate offset")
|
94 |
|
|
|
95 |
|
|
(insn_dp_i "Data processing immidiate")
|
96 |
|
|
(insn_undef1 "Undefined instruction")
|
97 |
|
|
(insn_misr "Move immidiate to status register")
|
98 |
|
|
(insn_lsio "Load|Store imidiate offset")
|
99 |
|
|
(insn_lsro "Load|Store register offset")
|
100 |
|
|
(insn_undef2 "Undefined instruction2")
|
101 |
|
|
(insn_undef3 "Undefined instruction3")
|
102 |
|
|
(insn_lsm "Load|Store multiple")
|
103 |
|
|
(insn_undef4 "Undefined instruction4")
|
104 |
|
|
(insn_bwl "Branch with link")
|
105 |
|
|
(insn_bwlth "Branch with link and change to thumb")
|
106 |
|
|
|
107 |
|
|
(insn_cpldst "Coprocessor Load Store")
|
108 |
|
|
|
109 |
|
|
(insn_cpdp "Coprocessor data processing")
|
110 |
|
|
(insn_cpr "Coprocessor register transfer")
|
111 |
|
|
|
112 |
|
|
(insn_swi "Software interrupt")
|
113 |
|
|
(insn_undef "Undef")
|
114 |
|
|
|
115 |
|
|
))
|
116 |
|
|
|
117 |
|
|
|
118 |
|
|
;; list order 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
119 |
|
|
;; 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
|
120 |
|
|
(setq insn_dp_i_s '( c c c c 0 0 0 op1 op1 op1 op1 dps rn rn rn rn rd rd rd rd sha sha sha sha sha sh sh 0 rm rm rm rm ))
|
121 |
|
|
|
122 |
|
|
(setq insn_msr '( c c c c 0 0 0 1 0 R 0 0 SBO SBO SBO SBO rd rd rd rd SBZ SBZ SBZ SBZ 0 0 0 0 SBZ2 SBZ2 SBZ2 SBZ2 ))
|
123 |
|
|
(setq insn_mrs '( c c c c 0 0 0 1 0 R 1 0 msk msk msk msk SBO SBO SBO SBO SBZ SBZ SBZ SBZ 0 0 0 0 rm rm rm rm ))
|
124 |
|
|
(setq insn_bex '( c c c c 0 0 0 1 0 0 1 0 SBO SBO SBO SBO SBO SBO SBO SBO SBO SBO SBO SBO 0 0 0 1 rm rm rm rm ))
|
125 |
|
|
(setq insn_clz '( c c c c 0 0 0 1 0 1 1 0 SBO SBO SBO SBO rd rd rd rd SBO2 SBO2 SBO2 SBO2 0 0 0 1 rm rm rm rm ))
|
126 |
|
|
(setq insn_blx '( c c c c 0 0 0 1 0 0 1 0 SBO SBO SBO SBO SBO SBO SBO SBO SBO SBO SBO SBO 0 0 1 1 rm rm rm rm ))
|
127 |
|
|
(setq insn_dsa '( c c c c 0 0 0 1 0 dsop dsop 0 rn rn rn rn rd rd rd rd SBZ SBZ SBZ SBZ 0 1 0 1 rm rm rm rm ))
|
128 |
|
|
(setq insn_brk '( c c c c 0 0 0 1 0 0 1 0 imm imm imm imm imm imm imm imm imm imm imm imm 0 1 1 1 imm2 imm2 imm2 imm2 ))
|
129 |
|
|
(setq insn_dsm '( c c c c 0 0 0 1 0 dsop dsop 0 RD RD RD RD rn rn rn rn rs rs rs rs 1 y x 0 rm rm rm rm ))
|
130 |
|
|
|
131 |
|
|
(setq insn_dp_r_s '( c c c c 0 0 0 op1 op1 op1 op1 dps rn rn rn rn rd rd rd rd rs rs rs rs 0 sh sh 1 rm rm rm rm ))
|
132 |
|
|
|
133 |
|
|
(setq insn_mula '( c c c c 0 0 0 0 0 0 MA MS rd rd rd rd rn rn rn rn rs rs rs rs 1 0 0 1 rm rm rm rm ))
|
134 |
|
|
(setq insn_mull '( c c c c 0 0 0 0 1 MU MA MS rd rd rd rd rdl rdl rdl rdl rs rs rs rs 1 0 0 1 rm rm rm rm ))
|
135 |
|
|
|
136 |
|
|
(setq insn_swp '( c c c c 0 0 0 1 0 SB 0 0 rn rn rn rn rd rd rd rd sbz sbz sbz sbz 1 0 0 1 rm rm rm rm ))
|
137 |
|
|
|
138 |
|
|
(setq insn_ld1 '( c c c c 0 0 0 LSP LSU 0 LSW LSL rn rn rn rn rd rd rd rd sbz sbz sbz sbz 1 0 1 1 rm rm rm rm ))
|
139 |
|
|
(setq insn_ld2 '( c c c c 0 0 0 LSP LSU 1 LSW LSL rn rn rn rn rd rd rd rd i81 i81 i81 i81 1 0 1 1 i82 i82 i82 i82 ))
|
140 |
|
|
(setq insn_ld3 '( c c c c 0 0 0 LSP LSU 0 LSW 0 rn rn rn rn rd rd rd rd i81 i81 i81 i81 1 1 S 1 i82 i82 i82 i82 ))
|
141 |
|
|
(setq insn_ld4 '( c c c c 0 0 0 LSP LSU 0 LSW 1 rn rn rn rn rd rd rd rd i81 i81 i81 i81 1 1 H 1 i82 i82 i82 i82 ))
|
142 |
|
|
(setq insn_ld5 '( c c c c 0 0 0 LSP LSU 1 LSW 0 rn rn rn rn rd rd rd rd i81 i81 i81 i81 1 1 S 1 i82 i82 i82 i82 ))
|
143 |
|
|
(setq insn_ld6 '( c c c c 0 0 0 LSP LSU 1 LSW 1 rn rn rn rn rd rd rd rd i81 i81 i81 i81 1 1 H 1 i82 i82 i82 i82 ))
|
144 |
|
|
|
145 |
|
|
(setq insn_dp_i '( c c c c 0 0 1 op1 op1 op1 op1 dps rn rn rn rn rd rd rd rd rot rot rot rot dpi dpi dpi dpi dpi dpi dpi dpi ))
|
146 |
|
|
(setq insn_undef1 '( c c c c 0 0 1 1 0 X2 0 0 X X X X X X X X X X X X X X X X X X X X ))
|
147 |
|
|
(setq insn_misr '( c c c c 0 0 1 1 0 R 1 0 MSK MSK MSK MSK SBQ SBQ SBQ SBQ rot rot rot rot dpi dpi dpi dpi dpi dpi dpi dpi ))
|
148 |
|
|
(setq insn_lsio '( c c c c 0 1 0 LSP LSU LSB LSW LSL rn rn rn rn rd rd rd rd LSI LSI LSI LSI LSI LSI LSI LSI LSI LSI LSI LSI ))
|
149 |
|
|
(setq insn_lsro '( c c c c 0 1 1 LSP LSU LSB LSW LSL rn rn rn rn rd rd rd rd sha sha sha sha sha sh sh 0 rm rm rm rm ))
|
150 |
|
|
(setq insn_undef2 '( c c c c 0 1 1 X X X X X X X X X X X X X X X X X X X X 1 X2 X2 X2 X2 ))
|
151 |
|
|
(setq insn_undef3 '( 1 1 1 1 0 X X X X X X X X X X X X X X X X X X X X X X X X X X X ))
|
152 |
|
|
(setq insn_lsm '( c c c c 0 1 1 LSP LSU LMS LSW LSL rn rn rn rn rgl rgl rgl rgl rgl rgl rgl rgl rgl rgl rgl rgl rgl rgl rgl rgl ))
|
153 |
|
|
(setq insn_undef4 '( 1 1 1 1 1 0 0 X X X X X X X X X X X X X X X X X X X X X X X X X ))
|
154 |
|
|
(setq insn_bwl '( c c c c 1 0 1 BLL blo blo blo blo blo blo blo blo blo blo blo blo blo blo blo blo blo blo blo blo blo blo blo blo))
|
155 |
|
|
(setq insn_bwlth '( 1 1 1 1 1 0 1 BLH blo blo blo blo blo blo blo blo blo blo blo blo blo blo blo blo blo blo blo blo blo blo blo blo))
|
156 |
|
|
|
157 |
|
|
(setq insn_cpldst '( c c c c 1 1 0 LSP LSU Cp_N LSW LSL rn rn rn rn crd crd crd crd cpn cpn cpn cpn of8 of8 of8 of8 of8 of8 of8 of8 ))
|
158 |
|
|
(setq insn_cpdp '( c c c c 1 1 0 0 co1 co1 co1 co1 crn crn crn crn rd rd rd rd cpn cpn cpn cpn cp1 cp1 cp1 0 crm crm crm crm ))
|
159 |
|
|
(setq insn_cpr '( c c c c 1 1 0 0 co1 co1 co1 LSL crn crn crn crn rd rd rd rd cpn cpn cpn cpn cp1 cp1 cp1 1 crm crm crm crm ))
|
160 |
|
|
|
161 |
|
|
(setq insn_swi '( c c c c 1 1 1 1 X X X X X X X X X X X X X X X X X X X X X X X X ))
|
162 |
|
|
(setq insn_undef '( 1 1 1 1 1 1 1 1 X X X X X X X X X X X X X X X X X X X X X X X X ))
|
163 |
|
|
|
164 |
|
|
|
165 |
|
|
(setq insn '(
|
166 |
|
|
insn_dp_i_s insn_msr insn_mrs insn_bex insn_clz insn_blx insn_dsa
|
167 |
|
|
insn_brk insn_dsm insn_dp_r_s insn_mula insn_mull insn_swp insn_ld1
|
168 |
|
|
insn_ld2 insn_ld3 insn_ld4 insn_ld5 insn_ld6 insn_dp_i insn_undef1
|
169 |
|
|
insn_misr insn_lsio insn_lsro insn_undef2 insn_undef3 insn_lsm insn_undef4
|
170 |
|
|
insn_bwl insn_bwlth insn_cpldst insn_cpdp insn_cpr insn_swi insn_undef
|
171 |
|
|
))
|
172 |
|
|
|
173 |
|
|
(setq h (create-decoder-setenc (or-insn-set insn) insn 0))
|
174 |
|
|
;(insert (print-decoder h 0))
|
175 |
|
|
(insert (print-decoder-c-pre h))
|
176 |
|
|
(insert (print-decoder-c-structs insn insn-help))
|
177 |
|
|
;(insert (print-decoder-vhd-pre h))
|
178 |
|
|
|
179 |
|
|
)
|
180 |
|
|
|
181 |
|
|
|
182 |
|
|
|
183 |
|
|
|
184 |
|
|
|