Skip to content

Commit 50fdea3

Browse files
authored
Avalon
2 parents 1098e10 + 2880a0c commit 50fdea3

11 files changed

+559
-0
lines changed

Avalon/v1/AvalonCommon.vhdl

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
-- =============================================================================
2+
-- Authors:
3+
-- Parham Soltani
4+
--
5+
-- Package:
6+
-- Common types for Avalon Memory-Mapped (MM) interfaces
7+
--
8+
-- Description:
9+
-- Defines shared types for use in Avalon-MM records
10+
--
11+
-- License:
12+
-- =============================================================================
13+
-- Copyright 2025-2025 Open Source VHDL Group
14+
--
15+
-- Licensed under the Apache License, Version 2.0 (the "License");
16+
-- you may not use this file except in compliance with the License.
17+
-- You may obtain a copy of the License at
18+
--
19+
-- http://www.apache.org/licenses/LICENSE-2.0
20+
--
21+
-- Unless required by applicable law or agreed to in writing, software
22+
-- distributed under the License is distributed on an "AS IS" BASIS,
23+
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24+
-- See the License for the specific language governing permissions and
25+
-- limitations under the License.
26+
-- =============================================================================
27+
28+
library IEEE;
29+
use IEEE.std_logic_1164.all;
30+
use IEEE.numeric_std.all;
31+
32+
package AvalonCommon is
33+
-- Common types
34+
subtype Data_Type is std_ulogic_vector;
35+
subtype Address_Type is unsigned;
36+
subtype ByteEnable_Type is std_ulogic_vector;
37+
subtype BurstCount_Type is unsigned;
38+
39+
-- Avalon-MM Response
40+
subtype Response_Type is std_ulogic_vector(1 downto 0);
41+
constant AVALON_RESPONSE_OKAY : Response_Type := "00";
42+
constant AVALON_RESPONSE_RESERVED : Response_Type := "01";
43+
constant AVALON_RESPONSE_SLAVE_ERROR : Response_Type := "10";
44+
constant AVALON_RESPONSE_DECODE_ERROR : Response_Type := "11";
45+
46+
type Avalon_System_Interface is record
47+
Clock : std_ulogic;
48+
Reset : std_ulogic;
49+
end record;
50+
51+
end package;

Avalon/v1/AvalonMM.vhdl

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
-- =============================================================================
2+
-- Authors:
3+
-- Parham Soltani
4+
--
5+
-- Package:
6+
-- VHDL-2019 Avalon Memory-Mapped (Avalon-MM) interface descriptions
7+
--
8+
-- Description:
9+
-- Signal names match Avalon specification (address, writedata, readdata, etc.)
10+
--
11+
-- License:
12+
-- =============================================================================
13+
-- Copyright 2025-2025 Open Source VHDL Group
14+
--
15+
-- Licensed under the Apache License, Version 2.0 (the "License");
16+
-- you may not use this file except in compliance with the License.
17+
-- You may obtain a copy of the License at
18+
--
19+
-- http://www.apache.org/licenses/LICENSE-2.0
20+
--
21+
-- Unless required by applicable law or agreed to in writing, software
22+
-- distributed under the License is distributed on an "AS IS" BASIS,
23+
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24+
-- See the License for the specific language governing permissions and
25+
-- limitations under the License.
26+
-- =============================================================================
27+
28+
library IEEE;
29+
use IEEE.std_logic_1164.all;
30+
use IEEE.numeric_std.all;
31+
32+
use work.AvalonCommon.all;
33+
34+
package AvalonMM is
35+
-- Avalon Memory-Mapped Interface (matching spec signal names)
36+
type AvalonMM_Interface is record
37+
-- Master signals
38+
Address : Address_Type; -- Address
39+
Read : std_ulogic; -- Read request
40+
Write : std_ulogic; -- Write request
41+
WriteData : Data_Type; -- Write data
42+
ByteEnable : ByteEnable_Type; -- Byte enable
43+
44+
-- Slave signals
45+
ReadData : Data_Type; -- Read data
46+
ReadDataValid : std_ulogic; -- Read data valid
47+
WaitRequest : std_ulogic; -- Wait request
48+
Response : Response_Type; -- Response
49+
50+
-- Optional burst signals
51+
BurstCount : BurstCount_Type; -- Burst count
52+
53+
-- Optional pipelining signals
54+
WriteResponseValid : std_ulogic; -- Write response valid
55+
56+
-- Optional lock signal
57+
Lock : std_ulogic; -- Lock
58+
59+
-- Optional debug signals
60+
DebugAccess : std_ulogic; -- Debug access
61+
end record;
62+
type AvalonMM_Interface_Vector is array(natural range <>) of AvalonMM_Interface;
63+
64+
-- Master view (from master's perspective)
65+
view AvalonMM_MasterView of AvalonMM_Interface is
66+
-- Master outputs
67+
Address : out;
68+
Read : out;
69+
Write : out;
70+
WriteData : out;
71+
ByteEnable : out;
72+
BurstCount : out;
73+
Lock : out;
74+
DebugAccess : out;
75+
76+
-- Master inputs
77+
ReadData : in;
78+
ReadDataValid : in;
79+
WaitRequest : in;
80+
Response : in;
81+
WriteResponseValid : in;
82+
end view;
83+
alias AvalonMM_SlaveView is AvalonMM_MasterView'converse;
84+
85+
end package;

Avalon/v1/AvalonMM_Generic.vhdl

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
-- =============================================================================
2+
-- Authors:
3+
-- Parham Soltani
4+
--
5+
-- Package:
6+
-- Generic Avalon-MM interface for pre-constraining widths
7+
--
8+
-- Description:
9+
-- Uses spec-matching names (address, writedata, readdata, byteenable, etc.)
10+
--
11+
-- License:
12+
-- =============================================================================
13+
-- Copyright 2025-2025 Open Source VHDL Group
14+
--
15+
-- Licensed under the Apache License, Version 2.0 (the "License");
16+
-- you may not use this file except in compliance with the License.
17+
-- You may obtain a copy of the License at
18+
--
19+
-- http://www.apache.org/licenses/LICENSE-2.0
20+
--
21+
-- Unless required by applicable law or agreed to in writing, software
22+
-- distributed under the License is distributed on an "AS IS" BASIS,
23+
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24+
-- See the License for the specific language governing permissions and
25+
-- limitations under the License.
26+
-- =============================================================================
27+
28+
use work.AvalonMM.all;
29+
30+
package AvalonMM_Generic is
31+
generic (
32+
constant ADDRESS_BITS : positive;
33+
constant DATA_BITS : positive;
34+
constant BURSTCOUNT_BITS : positive := 1
35+
);
36+
37+
constant BYTEENABLE_BITS : positive := DATA_BITS / 8;
38+
39+
-- Full Avalon-MM interface with all optional signals
40+
subtype AvalonMM_SizedInterface is AvalonMM_Interface(
41+
Address(ADDRESS_BITS - 1 downto 0),
42+
WriteData(DATA_BITS - 1 downto 0),
43+
ReadData(DATA_BITS - 1 downto 0),
44+
ByteEnable(BYTEENABLE_BITS - 1 downto 0),
45+
BurstCount(BURSTCOUNT_BITS - 1 downto 0)
46+
);
47+
48+
subtype AvalonMM_SizedInterface_Vector is AvalonMM_Interface_Vector(open)(
49+
Address(ADDRESS_BITS - 1 downto 0),
50+
WriteData(DATA_BITS - 1 downto 0),
51+
ReadData(DATA_BITS - 1 downto 0),
52+
ByteEnable(BYTEENABLE_BITS - 1 downto 0),
53+
BurstCount(BURSTCOUNT_BITS - 1 downto 0)
54+
);
55+
56+
end package;

Avalon/v1/AvalonMM_Minimal.vhdl

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
-- =============================================================================
2+
-- Authors:
3+
-- Parham Soltani
4+
--
5+
-- Package:
6+
-- Minimal Avalon Memory-Mapped interface
7+
--
8+
-- Description:
9+
-- Simplified Avalon MM interface without optional signals for basic use cases
10+
--
11+
-- License:
12+
-- =============================================================================
13+
-- Copyright 2025-2025 Open Source VHDL Group
14+
--
15+
-- Licensed under the Apache License, Version 2.0 (the "License");
16+
-- you may not use this file except in compliance with the License.
17+
-- You may obtain a copy of the License at
18+
--
19+
-- http://www.apache.org/licenses/LICENSE-2.0
20+
--
21+
-- Unless required by applicable law or agreed to in writing, software
22+
-- distributed under the License is distributed on an "AS IS" BASIS,
23+
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24+
-- See the License for the specific language governing permissions and
25+
-- limitations under the License.
26+
-- =============================================================================
27+
28+
library IEEE;
29+
use IEEE.std_logic_1164.all;
30+
use IEEE.numeric_std.all;
31+
32+
use work.AvalonCommon.all;
33+
34+
package AvalonMM_Minimal is
35+
-- Minimal Avalon MM interface (only essential signals)
36+
type AvalonMM_Minimal_Interface is record
37+
-- Master signals
38+
Address : Address_Type;
39+
Read : std_ulogic;
40+
Write : std_ulogic;
41+
WriteData : Data_Type;
42+
ByteEnable : ByteEnable_Type;
43+
44+
-- Slave signals
45+
ReadData : Data_Type;
46+
WaitRequest : std_ulogic;
47+
end record;
48+
type AvalonMM_Minimal_Interface_Vector is array(natural range <>) of AvalonMM_Minimal_Interface;
49+
50+
-- Master view
51+
view AvalonMM_Minimal_MasterView of AvalonMM_Minimal_Interface is
52+
-- Master outputs
53+
Address : out;
54+
Read : out;
55+
Write : out;
56+
WriteData : out;
57+
ByteEnable : out;
58+
59+
-- Master inputs (slave outputs)
60+
ReadData : in;
61+
WaitRequest : in;
62+
end view;
63+
alias AvalonMM_Minimal_SlaveView is AvalonMM_Minimal_MasterView'converse;
64+
65+
end package;
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
-- =============================================================================
2+
-- Authors:
3+
-- Parham Soltani
4+
--
5+
-- Package:
6+
-- Generic minimal Avalon Memory-Mapped interface for pre-constraining widths
7+
--
8+
-- Description:
9+
-- Provides sized versions of the minimal Avalon MM interface
10+
--
11+
-- License:
12+
-- =============================================================================
13+
-- Copyright 2025-2025 Open Source VHDL Group
14+
--
15+
-- Licensed under the Apache License, Version 2.0 (the "License");
16+
-- you may not use this file except in compliance with the License.
17+
-- You may obtain a copy of the License at
18+
--
19+
-- http://www.apache.org/licenses/LICENSE-2.0
20+
--
21+
-- Unless required by applicable law or agreed to in writing, software
22+
-- distributed under the License is distributed on an "AS IS" BASIS,
23+
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24+
-- See the License for the specific language governing permissions and
25+
-- limitations under the License.
26+
-- =============================================================================
27+
28+
use work.AvalonMM_Minimal.all;
29+
30+
package AvalonMM_Minimal_Generic is
31+
generic (
32+
constant ADDRESS_BITS : positive;
33+
constant DATA_BITS : positive
34+
);
35+
36+
constant BYTEENABLE_BITS : positive := DATA_BITS / 8;
37+
38+
-- Sized minimal interface
39+
subtype AvalonMM_Minimal_SizedInterface is AvalonMM_Minimal_Interface(
40+
Address(ADDRESS_BITS - 1 downto 0),
41+
WriteData(DATA_BITS - 1 downto 0),
42+
ReadData(DATA_BITS - 1 downto 0),
43+
ByteEnable(BYTEENABLE_BITS - 1 downto 0)
44+
);
45+
46+
subtype AvalonMM_Minimal_SizedInterface_Vector is AvalonMM_Minimal_Interface_Vector(open)(
47+
Address(ADDRESS_BITS - 1 downto 0),
48+
WriteData(DATA_BITS - 1 downto 0),
49+
ReadData(DATA_BITS - 1 downto 0),
50+
ByteEnable(BYTEENABLE_BITS - 1 downto 0)
51+
);
52+
53+
end package;

Avalon/v1/AvalonST.vhdl

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
-- =============================================================================
2+
-- Authors:
3+
-- Parham Soltani
4+
--
5+
-- Package:
6+
-- VHDL-2019 Avalon Streaming (Avalon-ST) interface descriptions
7+
--
8+
-- Description:
9+
-- Signal names match Avalon-ST specification (data, valid, ready, etc.)
10+
--
11+
-- License:
12+
-- =============================================================================
13+
-- Copyright 2025-2025 Open Source VHDL Group
14+
--
15+
-- Licensed under the Apache License, Version 2.0 (the "License");
16+
-- you may not use this file except in compliance with the License.
17+
-- You may obtain a copy of the License at
18+
--
19+
-- http://www.apache.org/licenses/LICENSE-2.0
20+
--
21+
-- Unless required by applicable law or agreed to in writing, software
22+
-- distributed under the License is distributed on an "AS IS" BASIS,
23+
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24+
-- See the License for the specific language governing permissions and
25+
-- limitations under the License.
26+
-- =============================================================================
27+
28+
library IEEE;
29+
use IEEE.std_logic_1164.all;
30+
use IEEE.numeric_std.all;
31+
32+
use work.AvalonCommon.all;
33+
34+
package AvalonST is
35+
-- Avalon Streaming Interface (matching spec signal names)
36+
type AvalonST_Interface is record
37+
-- Handshake signals
38+
Valid : std_ulogic; -- Valid
39+
Ready : std_ulogic; -- Ready
40+
41+
-- Payload signals
42+
Data : Data_Type; -- Data
43+
44+
-- Packet signals
45+
StartOfPacket : std_ulogic; -- Start of packet
46+
EndOfPacket : std_ulogic; -- End of packet
47+
Empty : std_ulogic_vector; -- Empty (number of empty symbols)
48+
49+
-- Error signal
50+
Error : std_ulogic_vector; -- Error
51+
52+
-- Channel signal
53+
Channel : std_ulogic_vector; -- Channel
54+
end record;
55+
type AvalonST_Interface_Vector is array(natural range <>) of AvalonST_Interface;
56+
57+
-- Source view (from source's perspective)
58+
view AvalonST_SourceView of AvalonST_Interface is
59+
-- Source outputs
60+
Valid : out;
61+
Data : out;
62+
StartOfPacket : out;
63+
EndOfPacket : out;
64+
Empty : out;
65+
Error : out;
66+
Channel : out;
67+
68+
-- Source inputs (sink outputs)
69+
Ready : in;
70+
end view;
71+
alias AvalonST_SinkView is AvalonST_SourceView'converse;
72+
73+
end package;

0 commit comments

Comments
 (0)