Skip to content
DenseChip
Learn
PracticeCode labInterview

DenseChip

Navigate

Menu

LearnPracticeCode labInterview

Tools

All toolsSV editorCode repoResume
DenseChip

Practice, courses, and chip-design tools in one focused workspace.

LearnPracticeCode labInterviewToolsLearning paths

© 2026 DenseChip

AboutRoadmapCareersInternshipsFAQContactPrivacyTerms
Skip to lesson

Course contents

  • Logic Synthesis Glossary
  • Logic Synthesis Cheatsheet
  • Synthesis Foundations14
  • Logic Optimisation and Mapping20
  • Constraints and Timing15
  • Sequential, FSM and Memory19
    • Flops, Resets and Enables
    • FSM Synthesis
    • Memory and Macro Inference
      • Flop Arrays or RAM Macros
      • Read and Write Port Styles
      • Byte Enables and Bypass Wrappers
      • Compilers, Macros and Wrappers
    • Retiming and Pipelining
  • Datapath Synthesis14
  • Area, Power and Test14
  • Verification, ECO and Handoff15
  • Flows and Debugging15
  • Interview and Judgment11
Loading lesson

←Sequential, FSM and Memory
  1. Topics
  2. Logic Synthesis
  3. Sequential, FSM and Memory
  4. Memory and Macro Inference

Part 4 of 9Part 4 of 9/Sequential, FSM and MemoryIntermediate

Memory and Macro Inference

When arrays become flops and when they become RAM macros.

  • 4topics
  • 4lessons

Every RTL array lands in one of two places, and the wrong one is discovered in the area report. Without the flop-versus-macro fork, every large table is a surprise and every wrapper looks like overhead.

After this lesson you can: decide flops or macro for a table from its size, ports, and read style, and list what each lesson proves with a recorded run.

Every RTL array lands in one of two places. A small table with awkward access becomes one flop per bit plus read muxes and write decode. A large table with few ports and a registered read becomes a macro instance: a compiled block the tool connects but never builds from gates. The four lessons below record both sides with Yosys: a flop-array sweep that grows linearly with bits, the port styles that decide which side an array lands on, the byte enables and bypass logic that wrap a macro, and the black-box boundary a compiled macro presents to synthesis.

Question

Flop array

RAM macro

Best size

Small tables, around a kilobit or less

Large tables, thousands of bits and up

Read style

Sync or async read

Sync read in most compiled macros

Port count

Many ports stay cheap while the memory is small

One or two ports; more ports cost area fast

Reset

Per-bit reset is natural

No per-bit reset; reset needs a wrapper

Flow

Mapped with the logic

Black box with a timing model plus a wrapper

Flop array or RAM macro decision.
Large tables with few ports and sync reads suit macros; the rest stays flops.

Lesson

What it covers

Flop Arrays or RAM Macros

A recorded depth and width sweep, the per-bit slope, and the crossover rule against an assumed macro block.

Read and Write Port Styles

Sync and async reads, one write port against two, and what memory_dff absorbs into a port.

Byte Enables and Bypass Wrappers

Per-byte write masks, read-during-write transparency, and a sat-proved bypass wrapper.

Compilers, Macros and Wrappers

Black-box macros in synthesis, wrapper contents, and macro selection from a list.

Check yourself A 32-entry table of 8-bit values: flops or macro, and why?

Flops. At 256 bits the table sits far below the roughly one-kilobit crossover against the assumed 20000-unit macro block, and a flop array needs no wrapper or timing model.

Carry one sentence per lesson: flop cost grows linearly with bits at about nineteen units a bit, sync reads suit macros while async reads force flops, byte enables mask writes and bypass fixes same-cycle reads, and macros arrive as black boxes with wrappers.

  • Small tables with awkward access stay flops; large tables with few sync ports become macros plus wrappers.

  • Read style and port count move the boundary while the memory is small; byte masks and bypass live in the wrapper.

  • Flop areas are recorded Yosys runs; macro blocks and menus are labelled assumptions, never measurements.

Rule of thumb: name the storage, the ports, and the read style before arguing about the area.

How this was checked

This hub runs nothing; every figure on it is a drawing that summarizes the lesson structure. The evidence for each claim sits on the four lesson pages, each recorded with the Yosys build used by the course checker (0.70+post series, scripts/tools/run-rtl-testbenches.mjs with COURSE=synth) and listed in that page's frame.

  • Interview: run a mock interview on this topic

PreviousNext: Flop Arrays or RAM Macros

Up next

Up nextFlop Arrays or RAM Macros

Sign in to save progress

Practice this lessonPrevious lessonReport an error

See also

  • Flops, Resets and Enables
  • FSM Synthesis
  • Retiming and Pipelining