OpenCores
URL https://opencores.org/ocsvn/steelcore/steelcore/trunk

Subversion Repositories steelcore

[/] [docs/] [timing.md] - Blame information for rev 11

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 11 rafaelcalc
# Timing Diagrams
2
 
3
## Instruction fetch
4
 
5
To fetch an instruction, the core places the instruction address on **I_ADDR**. The memory must place the instruction on **INSTR** at the next clock rising edge. The figure below shows the timing diagram of this process. In the figure, **mem[addrX]** denotes the instruction stored at the memory position **addrX**.
6
 
7
![Instruction fetch timing diagram](images/ifetch_wave.png)
8
 
9
## Data fetch
10
 
11
To fetch data from memory, the core puts the data address on **D_ADDR**. The memory must place the data on **DATA_IN** at the next clock rising edge. The figure below shows the timing diagram of this process. In the figure, **mem[addrX]** denotes the data stored at the memory position **addrX**.
12
 
13
![Data fetch timing diagram](images/dfetch_wave.png)
14
 
15
## Data writing
16
 
17
To write data to memory, the core drives **D_ADDR**, **DATA_OUT**, **WR_REQ** and **WR_MASK** signals as follows:
18
 
19
* **D_ADDR** receives the address of the memory position where the data must be written;
20
* **DATA_OUT** receives the data to be written;
21
* **WR_REQ** is set high;
22
* **WR_MASK** receives a byte-write enable mask that indicates which bytes of **DATA_OUT** must be written.
23
 
24
The memory must perform the write operation at the next clock rising edge. The core can request to write bytes, halfwords and words.
25
 
26
The figure below shows the process of writing data to memory. **DATA_IN** is not used in the process and appears only to show the memory contents after writing. The figure shows five clock cycles, in which the core requests to write in the second, third and fourth cycles. In the second clock cycle, the core requests to write the word **0x12345678** at the address **addr2**. In the third, requests to write the halfword **0xABCD** at the upper half of **addr2**, and in the fourth requests to write the byte **0xEF** at the second least significant byte of **addr2**. The value stored at **addr2** after each of these operations appears on **DATA_IN** and are highlighted in blue.
27
 
28
![Data writing timing diagram](images/dwrite_wave.png)
29
 
30
## Interrupt request
31
 
32
An external device (or an interrupt controller managing several devices) can request interrupts by setting high the appropriate IRQ signal, which is **E_IRQ** for external interrupts, **T_IRQ** for timer interrupts and **S_IRQ** for software interrupts. The IRQ signal of the requested interrupt must be set high for one clock cycle and set low for the next.
33
 
34
The figure below shows the timing diagram of the interrupt request process. Since the process is the same for all types of interrupt, **X_IRQ** is used to denote **E_IRQ**, **T_IRQ** or **S_IRQ**. **TRAP_ADDR** denotes the address of the trap handler first instruction.
35
 
36

37
38

39
 
40
## Time CSR update
41
 
42
When connected to a real-time counter, the core updates the **time** CSR with the value placed on **REAL_TIME** at each clock rising edge, as shown in the figure below. **timeX** denotes arbitrary time values.
43
 
44

45
46

powered by: WebSVN 2.1.0

© copyright 1999-2021 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.