Skip to content
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

fixes for apicula support #2043

Merged
merged 2 commits into from
Aug 24, 2024
Merged

Conversation

pepijndevos
Copy link
Contributor

This maps Gowin IDE device families to Apicula database names, and updates the PLL generator to use the "revised PLL" primitive, which is basically the same as the PLL primitive but I guess they made some breaking changes to the implementation.

Stand by while I test more Gowin boards on Apicula in https://github.com/litex-hub/litex-boards/pull/603/files

Comment on lines 28 to 38
devicename = self.platform.devicename
# Non-exhaustive list of family aliases that Gowin IDE supports but don't have a unique database
if devicename == "GW1NR-9C":
devicename = "GW1N-9C"
elif devicename == "GW1NR-9":
devicename = "GW1N-9"
elif devicename == "GW1NSR-4C" or devicename == "GW1NSR-4":
devicename = "GW1NS-4"
elif devicename == "GW1NR-4C" or devicename == "GW1NR-4":
devicename = "GW1N-4"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not using a dict as done for xilinx ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because there is a many to one relationship and I doubt a dict is faster for small numbers but also because I ported it from C. I don't really have strong feelings one way or the other.

@trabucayre
Copy link
Collaborator

for PLLvs rPLL it make sense to also test with gowin's tools to verify for non regression.

@pepijndevos
Copy link
Contributor Author

pepijndevos commented Aug 19, 2024

It makes sense but I don't wanna 😭 getting their stuff to work on Arch is such a pain, which is why we use docker.

Our rPLL has exactly the same ports and parameters as the Gowin one, as documented in their clock primitive docs.

The more important thing to verify is that there aren't any other parameter changes that need adjustment.

@pepijndevos
Copy link
Contributor Author

I did some digging and found an old datasheet with the original PLL documentation, which allowed me to diff the actual changes in rPLL:

--- pll.vhdl    2024-08-21 10:29:48.268678073 +0200
+++ rpll.vhdl   2024-08-21 10:21:43.595398786 +0200
@@ -1,5 +1,5 @@
 architecture Behavioral of Four_Bit_Adder is
-  component PLL
+  component rPLL
     generic
     (
       FCLKIN           : string  := "100.0";
@@ -27,15 +27,13 @@
     );
     port
     (
-      CLKIN      : in std_logic_vector;
+      CLKIN      : in std_logic;
       CLKFB      : in std_logic;
       IDSEL      : in std_logic_vector(5 downto 0);
       FBDSEL     : in std_logic_vector(5 downto 0);
       ODSEL      : in std_logic_vector(5 downto 0);
-      RESET      : in std_logic := '0';
-      RESET_P    : in std_logic := '0';
-      RESET_I    : in std_logic := '0';
-      RESET_S    : in std_logic := '0';
+      RESET      : in std_logic;
+      RESET_P    : in std_logic;
       PSDA, FDLY : in std_logic_vector(3 downto 0);
       DUTYDA     : in std_logic_vector(3 downto 0);
       LOCK       : out std_logic;

as you can see the main change is the removal of those two reset parameters, and CLKIN is no longer a vector(???), other than that they are the same primitive with the same parameters and ports.

@pepijndevos pepijndevos marked this pull request as ready for review August 22, 2024 14:02
@pepijndevos
Copy link
Contributor Author

That's all for currently working boards

@trabucayre
Copy link
Collaborator

I will try to build/test bitstreams with gowin toolchain and your PLL's modification to check messages/behavior

@pepijndevos
Copy link
Contributor Author

Actually I should just get the gowin tools working to test both there PRs

@pepijndevos
Copy link
Contributor Author

Confirmed working with Gowin IDE

@trabucayre trabucayre merged commit ef775e0 into enjoy-digital:master Aug 24, 2024
1 check passed
@trabucayre
Copy link
Collaborator

Applied. Thanks @pepijndevos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants