CDL Modules
bbc_micro_types.h
Go to the documentation of this file.
1 
23 /*a Includes */
24 include "video.h"
25 
26 /*a Types */
27 /*t t_bbc_keyboard */
41 typedef struct {
46 
47 /*t t_bbc_pixels_per_clock */
65 typedef enum[3] {
72 
73 /*t t_bbc_display */
84 typedef struct {
86  bit hsync;
87  bit vsync;
89  bit[8] red;
90  bit[8] green;
91  bit[8] blue;
93 
94 /*t t_bbc_display_sram_write */
109 typedef struct {
110  bit enable;
111  bit[48] data;
112  bit[16] address;
114 
115 /*t t_bbc_floppy_sector_id */
128 typedef struct {
129  bit[7] track;
130  bit head;
133  bit bad_crc;
137 
138 /*t t_bbc_floppy_op */
179 typedef struct {
180  bit step_out; // towards track 0
181  bit step_in;
182  bit next_id;
185  bit[32] write_data;
189 
190 /*t t_bbc_floppy_response */
224 typedef struct {
227  bit index; // assert if sector_id is the first sector of the track
229  bit[32] read_data;
230  bit track_zero; // assert if the current track is track 0
231  bit write_protect; // assert if the disk is write protected (independent of valid)
232  bit disk_ready; // assert if the disk is loaded (independent of valid)
234 
235 /*t t_bbc_floppy_sram_request */
241 typedef struct {
242  bit enable;
244  bit[20] address;
245  bit[32] write_data;
247 
248 /*t t_bbc_floppy_sram_response */
254 typedef struct {
255  bit ack;
257  bit[32] read_data;
259 
260 /*t t_bbc_clock_control */
269 typedef struct {
270  bit enable_cpu "Asserted if the rising edge of 'clk' should also be a rising CPU clock edge";
271  bit will_enable_2MHz_video "Asserted if 'enable_2MHz_video' will be asserted in the next 'clk' period";
272  bit enable_2MHz_video "Asserted if the rising edge of 'clk' should also be a rising video '2MHz' clock edge";
273  bit enable_1MHz_rising "Asserted if the rising edge of 'clk' should also be a rising '1MHz' clock edge";
274  bit enable_1MHz_falling "Asserted if the rising edge of 'clk' should also be a falling '1MHz' clock edge";
275  bit[2] phi "Phase of BBC 6502 clock operation - in a real BBC micro this comes from the CPU";
276  bit reset_cpu "Asserted if the CPU should be reset, controlled by a CSR register";
277  bit[4] debug;
279 
280 /*t t_bbc_clock_status */
287 typedef struct {
288  bit cpu_1MHz_access "Asserted by the BBC micro if a 1MHz peripheral is being accessed - this the CPU clock enables to align with the 1MHz clock enables";
290 
291 /*t t_bbc_micro_sram_request */
319 typedef struct {
320  bit valid "Asserted to indicate that an SRAM request is valid";
321  bit read_enable "Constant during 'valid', indicates if a read access is required. Exclusive with write_enable";
322  bit write_enable "Constant during 'valid', indicates if a write access is required. Exclusive with read_enable";
323  bit[8] select "Constant during 'valid', indicates which SRAM should be accessed. Usually one of t_bbc_sram_select";
324  bit[24] address "Constant during 'valid', indicates address in SRAM should be accessed.";
325  bit[64] write_data "Constant during 'valid', contains data to be written to SRAM (if write_enable is asserted) - ignored otherwise.";
327 
328 /*t t_bbc_micro_sram_response */
334 typedef struct {
335  bit ack "Asserted to indicate that a SRAM request has been taken - held high until valid is deasserted";
336  bit read_data_valid "Asserted when the read data from an SRAM request is valid";
337  bit[64] read_data "Read data from an SRAM request, valid with read_data_valid, zero in all other cycles";
339 
340 /*t t_bbc_csr_select */
345 typedef enum[16] {
352 
353 /*t t_bbc_sram_select */
358 typedef enum[8] {
Definition: bbc_micro_types.h:363
bit reset_pressed
Definition: bbc_micro_types.h:42
Definition: bbc_micro_types.h:350
bit bad_data_crc
Definition: bbc_micro_types.h:134
t_bbc_floppy_sector_id sector_id
Definition: bbc_micro_types.h:226
bit[6] sector_number
Definition: bbc_micro_types.h:131
bit deleted_data
Definition: bbc_micro_types.h:135
Definition: bbc_micro_types.h:254
bit clock_enable
Definition: bbc_micro_types.h:85
Definition: bbc_micro_types.h:269
Definition: bbc_micro_types.h:68
bit[64] keys_down_cols_0_to_7
Definition: bbc_micro_types.h:43
bit step_in
Definition: bbc_micro_types.h:181
bit read_data_valid
Definition: bbc_micro_types.h:228
bit write_data_enable
Definition: bbc_micro_types.h:184
Definition: bbc_micro_types.h:67
Definition: bbc_micro_types.h:362
Definition: bbc_micro_types.h:334
Definition: bbc_micro_types.h:365
bit[16] keys_down_cols_8_to_9
Definition: bbc_micro_types.h:44
Definition: bbc_micro_types.h:319
bit bad_crc
Definition: bbc_micro_types.h:133
t_bbc_csr_select
Definition: bbc_micro_types.h:345
Definition: bbc_micro_types.h:128
bit write_protect
Definition: bbc_micro_types.h:231
bit[32] read_data
Definition: bbc_micro_types.h:229
Definition: bbc_micro_types.h:370
Definition: bbc_micro_types.h:69
bit[16] address
Definition: bbc_micro_types.h:112
bit[8] red
Definition: bbc_micro_types.h:89
t_bbc_pixels_per_clock pixels_per_clock
Definition: bbc_micro_types.h:88
Definition: bbc_micro_types.h:70
Definition: bbc_micro_types.h:349
bit[8] blue
Definition: bbc_micro_types.h:91
bit vsync
Definition: bbc_micro_types.h:87
t_bbc_sram_select
Definition: bbc_micro_types.h:358
t_bbc_floppy_sector_id sector_id
Definition: bbc_micro_types.h:187
bit[2] sector_length
Definition: bbc_micro_types.h:132
bit step_out
Definition: bbc_micro_types.h:180
bit sector_id_valid
Definition: bbc_micro_types.h:225
Definition: bbc_micro_types.h:66
bit[20] address
Definition: bbc_micro_types.h:244
bit head
Definition: bbc_micro_types.h:130
Definition: bbc_micro_types.h:84
bit[4] debug
Definition: bbc_micro_types.h:277
Definition: bbc_micro_types.h:364
Definition: bbc_micro_types.h:109
Definition: bbc_micro_types.h:287
bit track_zero
Definition: bbc_micro_types.h:230
bit index
Definition: bbc_micro_types.h:227
Definition: bbc_micro_types.h:179
bit read_data_valid
Definition: bbc_micro_types.h:256
Definition: bbc_micro_types.h:367
bit enable
Definition: bbc_micro_types.h:242
bit read_not_write
Definition: bbc_micro_types.h:243
bit ack
Definition: bbc_micro_types.h:255
bit hsync
Definition: bbc_micro_types.h:86
Definition: bbc_micro_types.h:368
Definition: bbc_micro_types.h:348
bit[48] data
Definition: bbc_micro_types.h:111
Definition: bbc_micro_types.h:360
bit[8] green
Definition: bbc_micro_types.h:90
bit[32] read_data
Definition: bbc_micro_types.h:257
Definition: bbc_micro_types.h:347
Definition: bbc_micro_types.h:366
t_bbc_pixels_per_clock
Definition: bbc_micro_types.h:65
bit[7] track
Definition: bbc_micro_types.h:129
Definition: bbc_micro_types.h:369
Definition: bbc_micro_types.h:41
Definition: bbc_micro_types.h:241
bit enable
Definition: bbc_micro_types.h:110
bit[32] write_data
Definition: bbc_micro_types.h:245
bit write_sector_id_enable
Definition: bbc_micro_types.h:186
Definition: bbc_micro_types.h:346
Definition: bbc_micro_types.h:361
bit next_id
Definition: bbc_micro_types.h:182
Definition: bbc_micro_types.h:224
bit disk_ready
Definition: bbc_micro_types.h:232
bit[32] write_data
Definition: bbc_micro_types.h:185
bit read_data_enable
Definition: bbc_micro_types.h:183
Definition: bbc_micro_types.h:359