Showing posts with label Hardware. Show all posts
Showing posts with label Hardware. Show all posts

Thursday, 8 March 2012

Digital system design flow




Specification:
We need to define the requirements and implementation constraints of our system like we design a software architecture. 

High-Level Design:
We need to define the top-level architecture, which includes the modules needed in the design and how they communicate with each other.

Low-Level Design:
Each module in this stage should be implemented using simple design components like memories, regsisters, state machines, etc.

HDL Coding:
Here we need to use HDL to write code to implement the low-level design. Here HDL code must be synthesisable.

Functional Simulation:
Here we use the software simulator to test if the HDL design does the right things which are required by the specification.

Synthesis:
After the simulation verified the design complete the requirement by specification, then map the HDL design to the target technology primitives, initial timing info is obtained.

Placement & Routing:
Here all the primitives in the synthesised netlist are mapped to a location on the target. Then connect the inputs and outputs to pins of FPGA. (passing of signals, clock trees are generated detailed timing information is obtained)

Tming Simulation:
After synthesis, you need to simulate the target again to chech that if the whole design meets the timing constraints set in the specification.

Fabrication:
For FPGA design, now all the works have been done. For an ASIC, mask sets are produced and silicon wafers are etched.

Post Silicon Validation:
After the chip is manufactured, we are supposed to test it in field conditions again. If there are bugs here, then all the chips become rubbish.

Saturday, 28 January 2012

Verilog杂七杂八


[1]"A module can contain any combination of following: net/variable declarations(wire, reg, integer, etc.), concurrent and sequential statement blocks, and instances of other modules(subhierarchies). Sequential statements are placed inside a begin/end block and executed in sequential order within the block. But the blocks themselves are executed concurrently, qualifying Verilog as a data language."

[2]"There is no need to explicitly declare wires; any undeclared identifiers default to wires. Note: undeclared wires must by single bit."

"All continuous assignments are active concurrently."

"In Verilog we use procedural blocks to model edge-triggered behaviour."

"An always block can be used to describe both combinational and sequential hardwire."

"All blocks in the design execute concurrently."

[5] "assign声明只能用在组合逻辑电路(combinational logic)中,不能用在always block中,即时序逻辑电路中(sequential logic)。"

reg vs wire:

[2]
reg signals can be
  • connected to the input port of a module instance
  • used as outputs in a module declaration
  • assigned to in an always @ block using <= or =
  • assigned to in an intial block (later)
  • used to create registers in an always @ (posedge clk) block
  • used for both sequential and combinational logic
wire signals can be
  • used to connect inputs and outputs of module instances
  • used as inputs and outputs in module declaration
  • can be assigned to with an assign statement
  • used to model only combinational logic
reg signals cannot be
  • connected to the output ports of a module instance
  • used as inputs in a module declaration
  • used on the left side of an assign statement
wire signals cannot be
  • used on the left side of a <= or = assignment in an always block
  • used to model sequential logic

     从上面的资料我们可以看出,wire一般用于blocks外面的线连接,仅仅是用来连接的,所以其没有记忆功能。而reg一般使用在blocks中像变量一样使用(也可以在blocks外面使用),配合着<=,可以实现状态间的数据传输,实现系统的记忆性。例如:
     always @ (posedge clk)
     begin
          q1<=in; 
          q2<=q1;
          out<=q2;
     end
     两个clock状态,前一个clock的数据能保留到当前clock的原因就是因为in, q1, q2都是reg类型。

     下面是一段来自百度百科对wire和reg不同较为准确地讲解:
     [4]"Verilog里一般不声明输出类型的话  默认是wire型的如果你想在输出处寄存一下:比如使用always语句,则必须声明为reg类型。wire是线网,就是相当于实际中的连接线,你想assign的话就是直接连接,就是用wire型,它的值是随时变化的。比如你想寄存一下,让他在时钟边沿才变化就需要reg类型了"

begin/end and fork/join

begin/end块内的语句都是顺序执行的,就像软件程序一样儿,当然要除去使用nonblocking "<="的情况。nonblocking的部分先同时计算"<="右边的部分,然后在遇到end的时候同时放到"<="左边的reg中。[6]

begin/end和fork/join可以互相嵌套。

Blocking and Nonblocking

Nonblocking "<=" :

"<=" 右边所有的表达式先计算,直到所有的计算都完成后(遇到end from "begin/end"),才将右边所得的所有计算结果assign到左边的register中。
用在sequential logic中。
实际上主要用于Flip-Flop circuit。

Blocking "=":

"=" 计算完立即放入左边,每一个式子都是这样。
用在combinational logic中。


Combinational logic(组合逻辑电路):

即,有输入就立即产生当前状态下的输出。没有任何"记忆性"。
Sequential logic(时序逻辑电路):

即,输出与过去的输入有关,所以系统具有"记忆"功能。







References:
[1] "Verilog Wikipedia", http://en.wikipedia.org/wiki/Verilog
[2] "2 - IntroVerilog Lecture", NTU embedded systems lectures
[3] "Blocking vs Nonblocking Assignments.pdf", in Dropbox
[4] "verilog变量reg和wire问题", 百度百科 http://zhidao.baidu.com/question/262629908.html?fr=qrl&cid=866&index=3
[5] "Verilog中的assign以及always", 百度百科 http://zhidao.baidu.com/question/358599023.html
[6] Procedual blocks: begin-end and fork-join http://electrosofts.com/verilog/beginend.html

Friday, 27 January 2012

Package on package design


Package on package design
Package on package (PoP) is an integrated circuit packaging method to combine vertically discrete logic (like processors) and memory ball grid array (BGA) packages which is used in A5 chip by iphone.There is a standard interface to route signals between different packages. It is shown as following:

Two widely used configurations exist for PoP:
1. Pure memory stacking - two or more memory only packages are stacked on each other
2. Mixed logic-memory stacking - logic (CPU) package on the bottom, memory package on top. For example, the bottom could be an application processor for a mobile phone. The logic package (processors) is on the bottom because it needs many more BGA connections to the motherboard.

Benifits:
  • 1), Mother space saving
  • Minizing track length between different interoperating parts, such as a controller and a memory.
1), faster signal propagation
2), reduced noise and cross-talk
  • Memory is decompled from logic device.
   1), The memory package can be tested separately from the logic package
   2), Only "known good" packages are used in final assembly (if the memory is bad only the memory is thrown away and so on).
   3), The end user (such as makers of mobile phones or digital cameras) controls the logistics.
   4), Because the construction is like Lego (乐高玩具), any mechanically mating top package can be used.
   5), Because the memory only comes into the mix at final assembly, there is no reason for logic suppliers to source any memory. With a
       stacked-die device, the logic provider must buy wafers of memory from a memory supplier.

Reference : http://en.wikipedia.org/wiki/Package_on_package Acessed: Nov 14, 2011.




Thursday, 26 January 2012


Synchronous and Asynchronous(in hardware communication)

Synchronous: different hardwares must use the same clock signal. For example, SPI protocol require the Master and Slave have to use the same clock signal which comes from Master.
Asynchronous: different hardwares can use different clock signal( the baudrate should be the same). For example, UART transmits data with 8 bits which contains start bit and/or stop bit used to verify if the data transmit is correct because of the different clocks they use. Please refer to the artile on 1st April 2011.

Serial Interfaces
SPI(Serial Peripheral Interface) is a serial interface standard. Basically, SPI need four pins which are: cs, clk, so and si. And most of SPI use Master-Slave mode to work.

cs: used to select the Slave chip. There is nothing to say about this part.
so: used to output bit stream. It works with clk pin to output bit at the positive edge of clk signal.
si: used to get bit stream. It also works with clk pin to get bit at the negtive edge of clk signal.
clk: used to provide synchronous signal which is created by the master chip.

So SPI can send and receive data at the same clk.
Note: Remember what counters is mechanism, maybe different companies have different implementation (maybe capture send at negtive edge of clk, receive data at positive edge of clk). Another thing you need to notice is that SPI is a protocol.


Sunday, 20 November 2011

Differences between ASIC, ASSP and ASIP


ASIC (Application Specified Integrated Circuit) is a customized integrated circuit. It is usually used by a person or company for a very limited usage. So when it is developed, only the person or company who orders it can use it. It is not useful for other usages, for example, an IC designed for a specific line of cellular phones of a company, whereby no other products can use it except the cell phones belonging to that product line.
- ASIC is just built for one and only one customer.
- ASIC is used only in one product line
- Only volume production of ASICs for one product can make sense which means low unit cost for high volume products, otherwise the cost is not efficient.
- Can exploit parallelism to achieve high performance
- Low power consumption

ASSP (Application Specified Standard Processor) is an integrated circuit that implements a specific function that appeals to a wide market, which means its function is specified for example a motor drive chip. But it is used widely, not limited to only one customer as ASIC does. So ASSPs are available as off-the-shelf components which means you can go to electronic shops and just buy it directly from the "shelf". It means ASSPs have been developed well and you can just buy it without designing it from scratch.
- It addresses the product space between ASIC and generic processor based products
- Extremely useful for low to medium volume applications because it help reduce cost and design overheads.

ASIP (application specific instruction processor) is usually used in SoC (System on a Chip). ASIP is an architecture including two parts which are a minimum ISA (Instruction Set Archietecture) and a configurable logic which you can use to design your own instruction set. So it provides relatively high flexibility compared to ASIC and better performance compared to FPGA (Field Programmable Gate Array). Also, it is cheaper than FPGA, but slightly more expensive than ASIC.
- ASIP can help build your own instruction set to meet your specific requirement.
- It provide a minimum ISA, which can make shorter TTM (Time to Market).

How to choose ASIC or ASSP?
- Whether TTM (Time-To-Marker) allows to design an ASIC
- Whether you have special requirement for your design which is not common in ASSPs, for example, you can exploit parallelism to achieve high performance
- Whether your products can have a big volume in market
- Power consumption requirement
- Whether software development tools are available
- How is the skill of the developers, whether they are capable for designing an ASIC
- Whether you can burden the technology risk for designing AISC
- How much is your plan for NRE (Non-Recurring Expense) cost to the project: ASIC needs relatively large NRE cost, and ASSP needs no NRE cost.

Chapter 3 — The Molt

(This story is written by me and I will be posting it on Royal Road. Profile: https://www.royalroad.com/profile/1129550/fictions) Six fifty ...