-
Notifications
You must be signed in to change notification settings - Fork 4
Feature/wishbone #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
parhamsoltani
wants to merge
5
commits into
VHDL:main
Choose a base branch
from
parhamsoltani:feature/wishbone
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Feature/wishbone #38
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
7f87dd9
Clean Wishbone interface only (restored for separate PR, including li…
parhamsoltani 40e3226
linebreaker added
parhamsoltani 1374138
Apply suggestions from code review
parhamsoltani e356e98
Apply naming convention changes: use full UpperCamelCase names
parhamsoltani a2b5aae
Merge branch 'main' into feature/wishbone
Paebbels File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| -- ============================================================================= | ||
| -- Authors: | ||
| -- Parham Soltani | ||
| -- | ||
| -- Package: | ||
| -- VHDL-2019 Wishbone interface descriptions | ||
| -- | ||
| -- Description: | ||
| -- Signal names use full descriptive UpperCamelCase names for clarity | ||
| -- | ||
| -- License: | ||
| -- ============================================================================= | ||
| -- Copyright 2025-2025 Open Source VHDL Group | ||
| -- | ||
| -- Licensed under the Apache License, Version 2.0 (the "License"); | ||
| -- you may not use this file except in compliance with the License. | ||
| -- You may obtain a copy of the License at | ||
| -- | ||
| -- http://www.apache.org/licenses/LICENSE-2.0 | ||
| -- | ||
| -- Unless required by applicable law or agreed to in writing, software | ||
| -- distributed under the License is distributed on an "AS IS" BASIS, | ||
| -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| -- See the License for the specific language governing permissions and | ||
| -- limitations under the License. | ||
| -- ============================================================================= | ||
|
|
||
| library IEEE; | ||
| use IEEE.std_logic_1164.all; | ||
| use IEEE.numeric_std.all; | ||
|
|
||
| use work.WishboneCommon.all; | ||
|
|
||
| package Wishbone is | ||
| -- Tag Interface for optional tag signals | ||
| type Wishbone_Tag_Interface is record | ||
| Cycle : Tag_Cycle_Type; | ||
| Address : Tag_Address_Type; | ||
| DataOut : Tag_Data_Type; | ||
| DataIn : Tag_Data_Type; | ||
| end record; | ||
|
|
||
| -- Full Wishbone Interface (using descriptive full names) | ||
| type Wishbone_Interface is record | ||
| -- Master signals (outputs from master perspective) | ||
| Cycle : std_ulogic; -- CYC_O - Cycle | ||
| Strobe : std_ulogic; -- STB_O - Strobe | ||
| WriteEnable : std_ulogic; -- WE_O - Write Enable | ||
| Address : Address_Type; -- ADR_O - Address | ||
| DataOut : Data_Type; -- DAT_O - Data (Master to Slave) | ||
| Select : Select_Type; -- SEL_O - Select | ||
|
|
||
| -- Slave signals (outputs from slave perspective) | ||
| Acknowledge : std_ulogic; -- ACK_I - Acknowledge | ||
| Error : std_ulogic; -- ERR_I - Error | ||
| Retry : std_ulogic; -- RTY_I - Retry | ||
| DataIn : Data_Type; -- DAT_I - Data (Slave to Master) | ||
|
|
||
| -- Optional signals for pipelined/burst modes | ||
| CycleType : CycleType_Type; -- CTI_O - Cycle Type Identifier | ||
| BurstType : BurstType_Type; -- BTE_O - Burst Type Extension | ||
|
|
||
| -- Optional signals | ||
| Tag : Wishbone_Tag_Interface; | ||
| Lock : std_ulogic; -- LOCK_O - Lock | ||
| Stall : std_ulogic; -- STALL_I - Pipeline stall | ||
| end record; | ||
| type Wishbone_Interface_Vector is array(natural range <>) of Wishbone_Interface; | ||
|
|
||
| -- Master view (from master's perspective) | ||
| view Wishbone_MasterView of Wishbone_Interface is | ||
| -- Master outputs | ||
| Cycle : out; | ||
| Strobe : out; | ||
| WriteEnable : out; | ||
| Address : out; | ||
| DataOut : out; | ||
| Select : out; | ||
| CycleType : out; | ||
| BurstType : out; | ||
| Tag : out; | ||
| Lock : out; | ||
|
|
||
| -- Master inputs (slave outputs) | ||
| Acknowledge : in; | ||
| Error : in; | ||
| Retry : in; | ||
| DataIn : in; | ||
| Stall : in; | ||
| end view; | ||
| alias Wishbone_SlaveView is Wishbone_MasterView'converse; | ||
|
|
||
| -- Simplified interface without optional signals | ||
| type Wishbone_Simple_Interface is record | ||
| -- Master signals | ||
| Cycle : std_ulogic; | ||
| Strobe : std_ulogic; | ||
| WriteEnable : std_ulogic; | ||
| Address : Address_Type; | ||
| DataOut : Data_Type; | ||
| Select : Select_Type; | ||
|
|
||
| -- Slave signals | ||
| Acknowledge : std_ulogic; | ||
| DataIn : Data_Type; | ||
| end record; | ||
| type Wishbone_Simple_Interface_Vector is array(natural range <>) of Wishbone_Simple_Interface; | ||
|
|
||
| view Wishbone_Simple_MasterView of Wishbone_Simple_Interface is | ||
| -- Master outputs | ||
| Cycle : out; | ||
| Strobe : out; | ||
| WriteEnable : out; | ||
| Address : out; | ||
| DataOut : out; | ||
| Select : out; | ||
|
|
||
| -- Master inputs | ||
| Acknowledge : in; | ||
| DataIn : in; | ||
| end view; | ||
| alias Wishbone_Simple_SlaveView is Wishbone_Simple_MasterView'converse; | ||
|
|
||
| end package; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| -- ============================================================================= | ||
| -- Authors: | ||
| -- Parham Soltani | ||
| -- | ||
| -- Package: | ||
| -- Common types for Wishbone interfaces | ||
| -- | ||
| -- Description: | ||
| -- Defines shared types like Address_Type, Data_Type for use in Wishbone | ||
| -- records, following the Wishbone B.4 specification. | ||
| -- | ||
| -- License: | ||
| -- ============================================================================= | ||
| -- Copyright 2025-2025 Open Source VHDL Group | ||
| -- | ||
| -- Licensed under the Apache License, Version 2.0 (the "License"); | ||
| -- you may not use this file except in compliance with the License. | ||
| -- You may obtain a copy of the License at | ||
| -- | ||
| -- http://www.apache.org/licenses/LICENSE-2.0 | ||
| -- | ||
| -- Unless required by applicable law or agreed to in writing, software | ||
| -- distributed under the License is distributed on an "AS IS" BASIS, | ||
| -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| -- See the License for the specific language governing permissions and | ||
| -- limitations under the License. | ||
| -- ============================================================================= | ||
|
|
||
| library IEEE; | ||
| use IEEE.std_logic_1164.all; | ||
| use IEEE.numeric_std.all; | ||
|
|
||
| package WishboneCommon is | ||
| -- Common types | ||
| subtype Data_Type is std_ulogic_vector; | ||
| subtype Address_Type is unsigned; | ||
| subtype Select_Type is std_ulogic_vector; | ||
| subtype Tag_Cycle_Type is std_ulogic_vector; | ||
| subtype Tag_Address_Type is std_ulogic_vector; | ||
| subtype Tag_Data_Type is std_ulogic_vector; | ||
|
|
||
| -- Cycle Type Identifiers (CTI) | ||
| subtype CycleType_Type is std_ulogic_vector(2 downto 0); | ||
| constant WB_CTI_CLASSIC : CycleType_Type := "000"; -- Classic cycle | ||
| constant WB_CTI_CONST_BURST : CycleType_Type := "001"; -- Constant address burst | ||
| constant WB_CTI_INCR_BURST : CycleType_Type := "010"; -- Incrementing burst | ||
| constant WB_CTI_END_OF_BURST : CycleType_Type := "111"; -- End of burst | ||
|
|
||
| -- Burst Type Extension (BTE) | ||
| subtype BurstType_Type is std_ulogic_vector(1 downto 0); | ||
| constant WB_BTE_LINEAR : BurstType_Type := "00"; -- Linear burst | ||
| constant WB_BTE_WRAP_4 : BurstType_Type := "01"; -- 4-beat wrap burst | ||
| constant WB_BTE_WRAP_8 : BurstType_Type := "10"; -- 8-beat wrap burst | ||
| constant WB_BTE_WRAP_16 : BurstType_Type := "11"; -- 16-beat wrap burst | ||
|
|
||
| type Wishbone_System_Interface is record | ||
| Clock : std_ulogic; | ||
| Reset : std_ulogic; | ||
| end record; | ||
|
|
||
| end package; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| -- ============================================================================= | ||
| -- Authors: | ||
| -- Parham Soltani | ||
| -- | ||
| -- Package: | ||
| -- Generic Wishbone interface for pre-constraining widths | ||
| -- | ||
| -- Description: | ||
| -- Uses full UpperCamelCase names matching the Wishbone interface records | ||
| -- | ||
| -- License: | ||
| -- ============================================================================= | ||
| -- Copyright 2025-2025 Open Source VHDL Group | ||
| -- | ||
| -- Licensed under the Apache License, Version 2.0 (the "License"); | ||
| -- you may not use this file except in compliance with the License. | ||
| -- You may obtain a copy of the License at | ||
| -- | ||
| -- http://www.apache.org/licenses/LICENSE-2.0 | ||
| -- | ||
| -- Unless required by applicable law or agreed to in writing, software | ||
| -- distributed under the License is distributed on an "AS IS" BASIS, | ||
| -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| -- See the License for the specific language governing permissions and | ||
| -- limitations under the License. | ||
| -- ============================================================================= | ||
|
|
||
| use work.Wishbone.all; | ||
|
|
||
| package Wishbone_Generic is | ||
| generic ( | ||
| constant ADDRESS_BITS : positive; | ||
| constant DATA_BITS : positive; | ||
| constant TGD_BITS : positive := 1; | ||
| constant TGA_BITS : positive := 1; | ||
| constant TGC_BITS : positive := 1 | ||
| ); | ||
|
|
||
| constant SEL_BITS : positive := DATA_BITS / 8; | ||
|
|
||
| -- Full Wishbone interface with all optional signals | ||
| subtype Wishbone_SizedInterface is Wishbone_Interface( | ||
| Address(ADDRESS_BITS - 1 downto 0), | ||
| DataOut(DATA_BITS - 1 downto 0), | ||
| DataIn(DATA_BITS - 1 downto 0), | ||
| Select(SEL_BITS - 1 downto 0), | ||
| Tag.DataOut(TGD_BITS - 1 downto 0), | ||
| Tag.DataIn(TGD_BITS - 1 downto 0), | ||
| Tag.Address(TGA_BITS - 1 downto 0), | ||
| Tag.Cycle(TGC_BITS - 1 downto 0) | ||
| ); | ||
|
|
||
| subtype Wishbone_SizedInterface_Vector is Wishbone_Interface_Vector(open)( | ||
| Address(ADDRESS_BITS - 1 downto 0), | ||
| DataOut(DATA_BITS - 1 downto 0), | ||
| DataIn(DATA_BITS - 1 downto 0), | ||
| Select(SEL_BITS - 1 downto 0), | ||
| Tag.DataOut(TGD_BITS - 1 downto 0), | ||
| Tag.DataIn(TGD_BITS - 1 downto 0), | ||
| Tag.Address(TGA_BITS - 1 downto 0), | ||
| Tag.Cycle(TGC_BITS - 1 downto 0) | ||
| ); | ||
|
|
||
| -- Simplified Wishbone interface | ||
| subtype Wishbone_Simple_SizedInterface is Wishbone_Simple_Interface( | ||
| Address(ADDRESS_BITS - 1 downto 0), | ||
| DataOut(DATA_BITS - 1 downto 0), | ||
| DataIn(DATA_BITS - 1 downto 0), | ||
| Select(SEL_BITS - 1 downto 0) | ||
| ); | ||
|
|
||
| subtype Wishbone_Simple_SizedInterface_Vector is Wishbone_Simple_Interface_Vector(open)( | ||
| Address(ADDRESS_BITS - 1 downto 0), | ||
| DataOut(DATA_BITS - 1 downto 0), | ||
| DataIn(DATA_BITS - 1 downto 0), | ||
| Select(SEL_BITS - 1 downto 0) | ||
| ); | ||
|
|
||
| end package; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it fail for signal
Select, because it's a reserved word?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, here is the CI result:
