GithubHelp home page GithubHelp logo

shalan / ms_dmac_ahbl Goto Github PK

View Code? Open in Web Editor NEW
8.0 1.0 5.0 48 KB

A Direct Memory Access Controller (DMAC) with AHB-lite bus interface

License: Apache License 2.0

Verilog 58.05% SystemVerilog 21.30% C 20.65%
ahb-lite asic dma dmac fpga verilog

ms_dmac_ahbl's Introduction

MS_DMAC_AHBL

Direct Memory Access Controller (DMAC) with AHB-lite bus interface.

Interfaces

โ€œโ€

Ports

Port name Direction Type Description
HCLK input System Clock
HRESETn input System Reset
IRQ output wire IRQ line to the CPU
PIRQ intput wire IRQ lines from peripherals requesting data transfer
HSEL input wire Slave Port HSEL
HADDR input wire [31:0] Slave Port HADDR
HTRANS input wire [1:0] Slave Port HTRANS
HWRITE input wire Slave Port HWRITE
HREADY input wire Slave Port HREADY
HWDATA input wire [31:0] Slave Port HWDATA
HSIZE input wire [2:0] Slave Port HSIZE
HREADYOUT output wire Slave Port HREADYOUT
HRDATA output wire [31:0] Slave Port HRDATA
M_HADDR output wire [31:0] Master Port HADDR
M_HTRANS output wire [1:0] Master Port HTRANS
M_HSIZE output wire [2:0] Master Port HSIZE
M_HWRITE output wire Master Port HWRITE
M_HWDATA output wire [31:0] Master Port HWDATA
M_HREADY input wire Master Port HREADY
M_HRDATA input wire [31:0] Master Port HRDATA

Slave Registers

Address Description
0x00 Control Register
0: EN
8-11: Transfer trigger; One bit for each of the 4 sources; 0000 means software trigger
16-17: Source data type; 0: byte, 1: half word, 2: word
18: Source Address Auto increment
24-25: Destination data type; 0: byte, 1: half word, 2: word
26: Destination Address Auto increment
0x04 Status Register
0: Done
0x08 Source Address Register
0x0C Destination Address Register
0x10 Data Size Register
0x14 SW Trigger Register
0x18 Frame Count Register

ms_dmac_ahbl's People

Contributors

m0stafarady avatar passant5 avatar shalan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

ms_dmac_ahbl's Issues

Add support for interrupts

Add support for receiving interrupts from peripherals. This way, the DMAC can transfer data from FIFO enabled peripherals every time the fifo is full w/o the need for interrupting the CPU. We are going to refer to the FIFO data as a frame.

Wrong auto increment behavior

The latest RTL change to enable different incremental step is not behaving like expected.
For example with this configuration,

    SourceDataType (1); // half word
    DestinationDataType(1); // half word 
    sourceAddrAI(4); // word step
    destinationAI(2); // half word step

The below results should be expected if we are moving array_1 into array_2
image
moving the first half from the source into the array
However, it moves the first half from first word and second half from second word
image

Waveform snapshot.
image

ahbl read write fsm missing default and runs 1 timer more than intended

The following FSM misses a default condition and it read and write 1 time after the done signal asserted.

always @*
case(state)
IDLE_STATE: if(TRIG_REG & CTRL_REG_EN)
nstate = RA_STATE;
else
nstate = IDLE_STATE;
RA_STATE: if(M_HREADY) nstate = RD_STATE; else nstate = RA_STATE;
RD_STATE: if(M_HREADY) nstate = WA_STATE; else nstate = RD_STATE;
WA_STATE: if(M_HREADY) nstate = WD_STATE; else nstate = WA_STATE;
WD_STATE: if(M_HREADY) begin
if(done)
nstate = IDLE_STATE;
else
nstate = RA_STATE;
end else nstate = WA_STATE;
endcase

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.