Visible to Intel only — GUID: mwh1409959613013
Ixiasoft
1.1. Using Provided HDL Templates
1.2. Instantiating IP Cores in HDL
1.3. Inferring Multipliers and DSP Functions
1.4. Inferring Memory Functions from HDL Code
1.5. Register and Latch Coding Guidelines
1.6. General Coding Guidelines
1.7. Designing with Low-Level Primitives
1.8. Cross-Module Referencing (XMR) in HDL Code
1.9. Using force Statements in HDL Code
1.10. Recommended HDL Coding Styles Revision History
1.4.1.1. Use Synchronous Memory Blocks
1.4.1.2. Avoid Unsupported Reset and Control Conditions
1.4.1.3. Check Read-During-Write Behavior
1.4.1.4. Controlling RAM Inference and Implementation
1.4.1.5. Single-Clock Synchronous RAM with Old Data Read-During-Write Behavior
1.4.1.6. Single-Clock Synchronous RAM with New Data Read-During-Write Behavior
1.4.1.7. Simple Dual-Port, Dual-Clock Synchronous RAM
1.4.1.8. True Dual-Port Synchronous RAM
1.4.1.9. Mixed-Width Dual-Port RAM
1.4.1.10. RAM with Byte-Enable Signals
1.4.1.11. Specifying Initial Memory Contents at Power-Up
1.6.6.1. If Performance is Important, Optimize for Speed
1.6.6.2. Use Separate CRC Blocks Instead of Cascaded Stages
1.6.6.3. Use Separate CRC Blocks Instead of Allowing Blocks to Merge
1.6.6.4. Take Advantage of Latency if Available
1.6.6.5. Save Power by Disabling CRC Blocks When Not in Use
1.6.6.6. Initialize the Device with the Synchronous Load (sload) Signal
3.4.1. Apply Complete System-Centric Timing Constraints for the Timing Analyzer
3.4.2. Force the Identification of Synchronization Registers
3.4.3. Set the Synchronizer Data Toggle Rate
3.4.4. Optimize Metastability During Fitting
3.4.5. Increase the Length of Synchronizers to Protect and Optimize
3.4.6. Increase the Number of Stages Used in Synchronizers
3.4.7. Select a Faster Speed Grade Device
Visible to Intel only — GUID: mwh1409959613013
Ixiasoft
1.6.4.3.2. SystemVerilog State Machine Coding Example
Use the following coding style to describe state machines in SystemVerilog.
SystemVerilog State Machine Using Enumerated Types
The module enum_fsm is an example of a SystemVerilog state machine implementation that uses enumerated types.
In Quartus® Prime Pro Edition synthesis, the enumerated type that defines the states for the state machine must be of an unsigned integer type. If you do not specify the enumerated type as int unsigned, synthesis uses a signed int type by default. In this case, the Quartus® Prime software synthesizes the design, but does not infer or optimize the logic as a state machine.
module enum_fsm (input clk, reset, input int data[3:0], output int o); enum int unsigned { S0 = 0, S1 = 2, S2 = 4, S3 = 8 } state, next_state; always_comb begin : next_state_logic next_state = S0; case(state) S0: next_state = S1; S1: next_state = S2; S2: next_state = S3; S3: next_state = S3; endcase end always_comb begin case(state) S0: o = data[3]; S1: o = data[2]; S2: o = data[1]; S3: o = data[0]; endcase end always_ff@(posedge clk or negedge reset) begin if(~reset) state <= S0; else state <= next_state; end endmodule