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

Add FMC SDRAM mezzanine card #3

Merged
merged 2 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@
url = git@github.com:chipsalliance/rocket-pcblib.git
[submodule "pmod_microsd/library"]
path = pmod_microsd/library
url = git@github.com:chipsalliance/rocket-pcblib.git
url = git@github.com:chipsalliance/rocket-pcblib.git
[submodule "fmc_sdram/library"]
path = fmc_sdram/library
url = git@github.com:chipsalliance/rocket-pcblib.git
4 changes: 4 additions & 0 deletions fmc_sdram/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.venv/
bom/
build/
production/
166 changes: 166 additions & 0 deletions fmc_sdram/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
cmake_minimum_required(VERSION 3.5)

project(fmc_sdram
VERSION 1.0.0
DESCRIPTION "FPGA mezzanine board with SDRAM and basic peripherals"
)

find_program(FRUGY_PROGRAM "frugy")
if(NOT FRUGY_PROGRAM)
message(FATAL_ERROR "frugy not found, please run `pip install frugy`")
endif()

find_program(KICADCLI_PROGRAM "kicad-cli")
if(NOT KICADCLI_PROGRAM)
message(FATAL_ERROR "kicad-cli not found, please install kicad8")
endif()

file(GLOB_RECURSE PROJECT_SCH_FILES ${CMAKE_CURRENT_LIST_DIR} "*.kicad_sch")
file(GLOB_RECURSE PROJECT_PCB_FILES ${CMAKE_CURRENT_LIST_DIR} "*.kicad_pcb")

set (PROJECT_PRODUCTION_FILES
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}_gerber/${CMAKE_PROJECT_NAME}_positions.csv"
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}_gerber/${CMAKE_PROJECT_NAME}-B_Cu.gbl"
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}_gerber/${CMAKE_PROJECT_NAME}-B_Mask.gbs"
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}_gerber/${CMAKE_PROJECT_NAME}-B_Paste.gbp"
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}_gerber/${CMAKE_PROJECT_NAME}-B_Silkscreen.gbo"
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}_gerber/${CMAKE_PROJECT_NAME}-Edge_Cuts.gm1"
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}_gerber/${CMAKE_PROJECT_NAME}-F_Cu.gtl"
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}_gerber/${CMAKE_PROJECT_NAME}-F_Mask.gts"
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}_gerber/${CMAKE_PROJECT_NAME}-F_Paste.gtp"
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}_gerber/${CMAKE_PROJECT_NAME}-F_Silkscreen.gto"
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}_gerber/${CMAKE_PROJECT_NAME}-In1_Cu.g2"
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}_gerber/${CMAKE_PROJECT_NAME}-In2_Cu.g3"
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}_gerber/${CMAKE_PROJECT_NAME}-NPTH.drl"
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}_gerber/${CMAKE_PROJECT_NAME}-PTH.drl"
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}_gerber/${CMAKE_PROJECT_NAME}-job.gbrjob"
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}_gerber/${CMAKE_PROJECT_NAME}_bom.xml"
)

add_custom_target(eeprom
ALL
DEPENDS
"${CMAKE_CURRENT_BINARY_DIR}/fmc_fru_eeprom.bin"
)

add_custom_command(
OUTPUT
"${CMAKE_CURRENT_BINARY_DIR}/fmc_fru_eeprom.bin"
COMMENT
"Generate the FRU eeprom data using frugy"
COMMAND
${FRUGY_PROGRAM}
"${CMAKE_CURRENT_SOURCE_DIR}/data/fmc_fru_eeprom.yml"
-o "${CMAKE_CURRENT_BINARY_DIR}/fmc_fru_eeprom.bin"
-e 2048
DEPENDS
"${CMAKE_CURRENT_SOURCE_DIR}/data/fmc_fru_eeprom.yml"
)

add_custom_target(production
ALL
DEPENDS
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}_gerber.zip"
${PROJECT_PRODUCTION_FILES}
)

add_custom_command(
OUTPUT
${PROJECT_PRODUCTION_FILES}
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}_gerber"
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}_gerber.zip"
COMMENT
"Generate the production files"
COMMAND
${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}_gerber"
COMMAND
${KICADCLI_PROGRAM} pcb export gerbers
--disable-aperture-macros
--no-x2
-o "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}_gerber/"
-l "B.Cu,B.Mask,B.Paste,B.SilkS,Edge.Cuts,F.Cu,F.Mask,F.Paste,F.SilkS,In1.Cu,In2.Cu,User.Drawings"
"${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.kicad_pcb"
COMMAND
${KICADCLI_PROGRAM} pcb export drill
--excellon-separate-th
--generate-map
--excellon-units mm
--excellon-zeros-format suppressleading
-o "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}_gerber/"
"${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.kicad_pcb"
COMMAND
${KICADCLI_PROGRAM} pcb export pos
--format csv --units mm --use-drill-file-origin --bottom-negate-x
-o "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}_gerber/${CMAKE_PROJECT_NAME}_positions.csv"
"${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.kicad_pcb"
COMMAND
${KICADCLI_PROGRAM} sch export bom
--preset "Grouped By Value"
-o "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}_gerber/${CMAKE_PROJECT_NAME}_bom.csv"
"${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.kicad_sch"
COMMAND
${CMAKE_COMMAND} -E tar "cfv" "${CMAKE_PROJECT_NAME}_gerber.zip" --format=zip
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}_gerber/"
DEPENDS
${PROJECT_PCB_FILES}
)

add_custom_target(pdf
ALL
DEPENDS
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}_sch.pdf"
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}_pcb.pdf"
)

add_custom_command(
OUTPUT
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}_sch.pdf"
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}_pcb.pdf"
COMMAND
${KICADCLI_PROGRAM} sch export pdf
--no-background-color
-o "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}_sch.pdf"
"${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.kicad_sch"
COMMAND
${KICADCLI_PROGRAM} pcb export pdf
--ibt
-l "B.Cu,B.Mask,B.Paste,B.SilkS,Edge.Cuts,F.Cu,F.Mask,F.Paste,F.SilkS,In1.Cu,In2.Cu,User.Drawings,*"
-o "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}_pcb.pdf"
"${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.kicad_pcb"
DEPENDS
${PROJECT_SCH_FILES}
)

add_custom_target(erc
ALL
DEPENDS
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}_erc.rpt"
)

add_custom_command(
OUTPUT
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}_erc.rpt"
COMMAND
${KICADCLI_PROGRAM} sch erc
--severity-error
--exit-code-violations
-o "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}_erc.rpt"
"${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.kicad_sch"
)

add_custom_target(drc
ALL
DEPENDS
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}_drc.rpt"
)

add_custom_command(
OUTPUT
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}_drc.rpt"
COMMAND
${KICADCLI_PROGRAM} pcb drc
--severity-error
--exit-code-violations
-o "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}_drc.rpt"
"${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.kicad_pcb"
)
43 changes: 43 additions & 0 deletions fmc_sdram/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# FMC_SDRAM

FMC mezannine card with dual MT48LC16M16A2 SDRAM, organized as 16Mx32bit, with level shifters for VADJ.
Also includes USB to UART bridge, JTAG level shifter with ARM 20-pin JTAG header.

![3D VIEW TOP](./image/fmc_sdram_3d_top.png)

![3D VIEW BOTTOM](./image/fmc_sdram_3d_bot.png)

## Preparation

Install kicad 8, cmake, ninja, frugy.

## Precautions

When using it for the first time, it is necessary to program the IPMI FRU data
for the EEPROM so that the development board can identify the power supply
of the FMC.

## Build

```bash
cmake -G Ninja -B build
cmake --build build
```

If you only need to build the eeprom binary,

```bash
cmake --build build --target eeprom
```

If you only need to generate a pdf of the schematic or pcb,

```bash
cmake --build build --target pdf
```

If you need to generate complete production data,

```bash
cmake --build build --target production
```
97 changes: 97 additions & 0 deletions fmc_sdram/data/fmc_fru_eeprom.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# The FMC specification includes a method where the FMC mezzanine module must
# provide hardware-defined information that can be read by an external
# controller on the FMC carrier platform.
# This hardware definition is defined by the FRU Information Store Recorder as
# defined in the Intel Platform Management FRU Information Store Definition V1.1
#
# Generate the FRU eeprom data using the following command:
# pip install frugy
# frugy fmc_fru_eeprom.yml -o fmc_fru_eeprom.bin -e 2048

BoardInfo:
manufacturer: CHIPS Alliance
product_name: FMC_SDRAM
serial_number: ebb63f7d9f0a
part_number: FMC_SDRAM
mfg_date_time: 2024-05-26 16:25:00
fru_file_id: '2024-05-26 16:25:00.000000'

MultirecordArea:
- type: DCLoad
output_number: P1_VADJ
nominal_voltage: 1800
min_voltage: 1710
max_voltage: 1890
max_noise_pk2pk: 0
min_current_load: 0
max_current_load: 1000

- type: DCLoad
output_number: P1_12P0V
nominal_voltage: 12000
min_voltage: 11400
max_voltage: 12600
max_noise_pk2pk: 0
min_current_load: 0
max_current_load: 10

- type: DCLoad
output_number: P1_3P3V
nominal_voltage: 3300
min_voltage: 3130
max_voltage: 3460
max_noise_pk2pk: 0
min_current_load: 0
max_current_load: 2000

- type: DCLoad
output_number: P1_VADJ
nominal_voltage: 1800
min_voltage: 1760
max_voltage: 1830
max_noise_pk2pk: 0
min_current_load: 0
max_current_load: 2000

- type: DCOutput
standby_enable: 0
output_number: P1_VREF_B_M2C
nominal_voltage: 0
max_neg_voltage: 0
max_pos_voltage: 0
max_noise_pk2pk: 0
min_current_draw: 0
max_current_draw: 0

- type: DCOutput
standby_enable: 0
output_number: P1_VREF_A_M2C
nominal_voltage: 0
max_neg_voltage: 0
max_pos_voltage: 0
max_noise_pk2pk: 0
min_current_draw: 0
max_current_draw: 0

- type: DCOutput
standby_enable: 0
output_number: P1_VIO_B_M2C
nominal_voltage: 0
max_neg_voltage: 0
max_pos_voltage: 0
max_noise_pk2pk: 0
min_current_draw: 0
max_current_draw: 0

- type: FmcMainDefinition
module_size: single_width
p1_connector_size: lpc
p2_connector_size: not_fitted
clock_direction: c2m
p1_a_num_signals: 66
p1_b_num_signals: 0
p2_a_num_signals: 0
p2_b_num_signals: 0
p1_gbt_num_trcv: 0
p2_gbt_num_trcv: 0
tck_max_clock: 0
Loading