|
1 | 1 | /*
|
2 |
| - * Copyright (c) 2023, Advanced Micro Devices, Inc. |
| 2 | + * Copyright (c) 2023-2024, Advanced Micro Devices, Inc. |
3 | 3 | * All rights reserved.
|
4 | 4 | *
|
5 | 5 | * Author: Eddie Hung, Advanced Micro Devices, Inc.
|
|
32 | 32 | import com.xilinx.rapidwright.support.RapidWrightDCP;
|
33 | 33 | import org.junit.jupiter.api.Assertions;
|
34 | 34 | import org.junit.jupiter.api.Test;
|
| 35 | +import org.junit.jupiter.api.function.Executable; |
35 | 36 | import org.junit.jupiter.params.ParameterizedTest;
|
36 | 37 | import org.junit.jupiter.params.provider.CsvSource;
|
37 | 38 |
|
|
41 | 42 | public class TestGlobalSignalRouting {
|
42 | 43 | @ParameterizedTest
|
43 | 44 | @CsvSource({
|
44 |
| - "CLKBWRCLK", |
45 |
| - "RSTRAMB" |
| 45 | + "CLKBWRCLK,", |
| 46 | + "RSTRAMB,", |
| 47 | + "WEBWE[0],WEBL0", |
| 48 | + "ADDRENA,ADDRENAL", |
| 49 | + "ADDRENB,ADDRENBU" |
46 | 50 | })
|
47 |
| - public void testRAMB36(String logicalPinName) { |
| 51 | + public void testRAMB36(String logicalPinName, String erroringSitePinName) throws Throwable { |
48 | 52 | Design design = new Design("design", "xcvu3p");
|
49 | 53 | Cell bufg = design.createAndPlaceCell("test_bufg", Unisim.BUFGCE, "BUFGCE_X0Y0/BUFCE");
|
50 |
| - Net globalNet = design.createNet("global"); |
| 54 | + Net globalNet = design.createNet("clk"); |
51 | 55 | globalNet.connect(bufg,"O");
|
52 | 56 |
|
53 | 57 | Cell target = design.createAndPlaceCell("test_ram", Unisim.RAMB36E2, "RAMB36_X0Y0/RAMB36E2");
|
54 |
| - if (logicalPinName.equals("CLKBWRCLK") || logicalPinName.equals("RSTRAMB")) { |
| 58 | + if (logicalPinName.equals("CLKBWRCLK") || logicalPinName.equals("RSTRAMB") || |
| 59 | + logicalPinName.equals("ADDRENA") || logicalPinName.equals("ADDRENB")) { |
55 | 60 | target.addPinMapping(logicalPinName + "L", logicalPinName);
|
56 | 61 | target.addPinMapping(logicalPinName + "U", logicalPinName);
|
| 62 | + } else if (logicalPinName.equals("WEBWE[0]")) { |
| 63 | + target.addPinMapping("WEBWEL0", logicalPinName); |
| 64 | + target.addPinMapping("WEBWEU0", logicalPinName); |
57 | 65 | }
|
58 | 66 | globalNet.connect(target, logicalPinName);
|
59 | 67 |
|
60 | 68 | // FIXME: Currently, Net.connect() only connects the first physical pin to the net
|
61 | 69 | // This is a canary assertion that will light up when this gets fixed.
|
62 | 70 | Assertions.assertEquals(2 /* 3 */, globalNet.getPins().size());
|
63 | 71 |
|
64 |
| - GlobalSignalRouting.symmetricClkRouting(globalNet, design.getDevice(), (n) -> NodeStatus.AVAILABLE); |
| 72 | + Executable e = () -> GlobalSignalRouting.symmetricClkRouting(globalNet, design.getDevice(), (n) -> NodeStatus.AVAILABLE); |
| 73 | + if (erroringSitePinName == null) { |
| 74 | + e.execute(); |
| 75 | + } else { |
| 76 | + // FIXME: Known broken -- see https://github.com/Xilinx/RapidWright/issues/756 |
| 77 | + RuntimeException ex = Assertions.assertThrows(RuntimeException.class, e, "true"); |
| 78 | + Assertions.assertEquals("ERROR: No mapped LCB to SitePinInst IN RAMB36_X0Y0." + erroringSitePinName, |
| 79 | + ex.getMessage()); |
| 80 | + } |
65 | 81 | }
|
66 | 82 |
|
67 | 83 | @Test
|
|
0 commit comments