火曜日, 9月 09, 2014

Using DFI memory controllers with the Altera PHY Interface (AFI) - Altera Wiki

Using DFI memory controllers with the Altera PHY Interface (AFI) - Altera Wiki

This is Google's cache of http://www.alterawiki.com/wiki/Using_DFI_memory_controllers_with_the_Altera_PHY_Interface_(AFI). It is a snapshot of the page as it appeared on 3 Sep 2014 01:48:17 GMT. The current page could have changed in the meantime. Learn more
Tip: To quickly find your search term on this page, press Ctrl+F or ⌘-F (Mac) and use the find bar.


Using DFI memory controllers with the Altera PHY Interface (AFI)

From Altera Wiki
Jump to: navigationsearch
0 / 5 (0 votes cast)



This article describes the basic method and limitations for how one might interconnect a memory controller using a DDR PHY Interface (DFI) to an Altera PHY IP core which uses the Altera PHY Interface (AFI). Altera has never tested this and this is purely a proposal from analyzing both interface specifications. DFI is not officially suported by Altera.

What is DFI?

The DDR PHY Interface (DFI) is a industry standard interface protocol that defines the connectivity between a DDR memory controller and a DDR PHY. The specification is managed by Denali Software Inc and allows for easy interchanging between DFI based PHY and memory controllers from different vendors, ASICs, etc

Whats is AFI?

The Altera PHY Interface (AFI) standardizes and simplifies the interface between controller and PHY for Altera’s DDR AltMemPHY and UniPHY IP based memory designs. It allows easy interchange of non Altera controller RTL with Altera's high-performance controllers by including the entire calibration logic (known as the sequencer) in the PHY.

AFI location diagram.jpg

Comparison of DFI and AFI

At a very basic level, AFI is a subset of DFI. Overall the interfaces are very similar however the DFI has some features that AFI does not support as listed in the following table:

AFI DFI Interface Comparison.jpg

AFI/DFI bridge proposal

In developing a bridge to convert DFI to AFI most signals should be able to be connected one to one on the supported sub-interface sections, with the exception of the write interface. These are listed as follows. (AlteMemPHY usually uses the ctl_<> signal name, UniPHY uses afi_<>. Care is required in setting the correct DFI parameters, as mentioned below.

Control Interface

dfi_address => ctl_addr/afi_addr

dfi_bank => ctl_ba/afi_ba

dfi_cas_n => ctl_casn/afi_cas_n

dfi_cke => ctl_cke/afi_cke

dfi_cs_n => ctl_csn/afi_cs_n

dfi_odt => ctl_odt/afi_odt

dfi_ras_n => ctl_rasn/afi_ras_n

dfi_reset_n => ctl_rstn/afi_rst_n

dfi_we_n => ctl_wen/afi_we_n

Write Interface

dfi_wrdata => ctl_wdata/afi_wdata

dfi_wrdata_en => see below

dfi_wrdata_mask => ctl_dm/afi_dm

Read Interface

dfi_rddata_en => ctl_doing_read/afi_rdata_en(_full)

dfi_rddata <= ctl_rdata/afi_rdata

dfi_rddata_valid <= ctl_rdata_valid/afi_rdata_valid

Status Interface

dfi_init_complete <= ctl_cal_success/afi_cal_success

dfi_dram_clk_disable => ctl_mem_clk_disable/afi_mem_clk_disable

Write Interface Functionality

The AFI write interface although similar to the DFI interface, it has an extra signal controlling the start of the DQS burst. Care needs to be taken to take the appropriate DFI information and generate this logic correctly. The following is a diagram showing two supported write modes on AFI, depending on whether a full rate or a half rate PHY is being used.

AFI write timing.jpg

As we can see, they dqs_burst signal goes high (or partially high in the half rate case) one clock cycle before the wdata and wdata_valid is asserted inline with the wdata. Also, (not shown here) is the timing relationship between the write data being presented on AFI relative to the write command being issued on AFI. This is determined by another AFI signal ctl_wlat which provides the controller the calibrated write latency value. The controller must drive ctl_cs_n (for the write command) and then wait ctl_wlat ctl_clk cycles before driving clt_wdata_valid and ctl_wdata.

The DFI write specification is shown in the following diagram (Figure 7 from the DFI specification):

DFI write timing.jpg

Once the write command is issued, wrdata_en is asserted tphy_wrlat cycles later, wdata is presented a further tphy_wrdata cycles after that.

There are plenty of options here to generate the required AFI logic depending on how the DFI controller is configured. The simplest might be doing the following:

  1. Set tphy_wrlat to ctl_wlat and tphy_wrdata to 1.
  2. Pass dfi_wrdata_en through a register and assign it to the AFI signal ctl_wdata_valid
  3. "OR" dfi_wdata_en and the registered version of it, and assign to ctl_dqs_burst  (or just the MSB bit in the half rate case, the LSB will be equivalent to ctl_wdata_valid) 
  4. dfi_wrdata connects to ctl_wdata directly

Read Interface Functionality

The read interface signals more or less line up one to one however one must ensure that the correct DFI controller has the correct parameter settings. The following diagram shows the timing required for AFI interfaces. Note that AltMemPHY half rate IP uses 2 bits for rdata_en and rdata_valid, these bits should be drive the same. Also note that afi_rdata_en is called ctl_doign_read with AltMemPHY IP. This stays high for as many clock cycles as local side beats that are required, ie. local_size (see Altera's EMI handbook for more info).

AFI read timing.jpg

DFI has the following timing on reads.

DFI read timing.jpg

To align this with AFI, trddata_en must be set to zero so that dfi_rdata_en is aligned with the read command. For AltMemPHY designs the calibrated read latency is presented to the AFI interface on signal ctl_rdlat, however UniPHY does not provide this information. This shouldn't be important for most DFI controllers as rddata_valid is provided by the PHY and the controller should be just waiting for it, however if tphy_rdlat is required to be set correctly, most likely one would have to use AltMemPHY.


  1. DFI is not officially supported by Altera
  2. The proposed solution in this article has never been tested
  3. Altera recommends using UniPHY IP on all new designs with device support 

External Links

  1. Altera's External Memory Interface Solutions Center
  2. Altera's External Memory Interface Handbook
  3. DFI Specification

Key Words

AFI, DFI, external memory PHY interfaces, Denali , Altera PHY interface, DDR PHY interface

© 2010 Altera Corporation. The material in this wiki page or document is provided AS-IS and is not
supported by Altera Corporation. Use the material in this document at your own risk; it might be, for example, objectionable,
misleading or inaccurate.Retrieved from http://www.alterawiki.com/wiki/Altera_Wiki

木曜日, 9月 04, 2014

【心得】5-4-A的血汗練法 (四輕空一戰一潛) @艦隊收藏 哈啦板 - 巴哈姆特

【心得】5-4-A的血汗練法 (四輕空一戰一潛) @艦隊收藏 哈啦板 - 巴哈姆特



輕空母速成 (經驗高,3-2基礎經驗一場320,5-4基礎經驗一場420)
水桶消耗較大 (大部分用在潛艦,如果有低等潛艦供替換,可減少水桶量)




5-4海域情報 (艦隊これくしょん -艦これ- 攻略 Wiki*)
可周回    可單點 (A、F點)

走上路,1戰2重1航巡2空,全高速,帶四罐,6 烈風 2 流星改

接下來是正文了... 最近我使用的5-4-A血汗練法


3-2-1血汗    4-3炸魚

  1. 棲艦三種組合,有一種組合有輕空母*1,為了搶制空,要帶艦戰
  2. 經驗、風險(水桶消耗)都比血汗3-2-1大
    • 有一種組合有重巡*1,我方輕空母被打到容易中大破
    • 有一種組合是輪型陣,我方潛艦容易中大破


4輕母 1戰 1潛   制空權確保   複縱

RJ  75  流星改  天山(友永隊)   Ju87C改      15.5三連裝副砲
瑞鳳  44  32電探  流星改     九九艦爆(熟練)   彩雲
千代田 68  32電探  烈風改     彗星一二型甲   流星改
飛鷹  65  流星改  Ju87C改     32電探      零式艦戰21型(熟練)
比叡  95  46砲   15.5副砲    水觀        14電探
伊號  79  閃避罐*2

  陪練艦等級建議至少50以上 (50以下不是不可,但可能損害較大、不易拿S)

  旗艦閃亮,使MVP集中,也穩定火力 (降低損害風險)

輕母中破    → 水桶
潛艦/戰艦大破 → 水桶

每場消耗   (統計了50場)

耗鋁:平均19.8   5*2 + 10*6 + 15*8 + 20*16 + 25*13 + 30*4 + 35*1
水桶:平均0.46   0*27 + 1*23
油 56

但是為了讓RJ的MVP穩定一點,所以RJ的副砲是放在最小的格子 (因此會多耗一點鋁)


把輕母換成正空母也可以,不過相對的耗鋁會增加 (搭載量較大)

重巡 → 5-4周回、演習
輕巡/驅逐 → 4-3
空母 → 陪練
輕母 → 5-4-A血汗
戰艦 → 演習、陪練




 轉寄 列印

















   節選自:《大起底:四大名著裏的本意與隱喻》/汪宏華 著

水曜日, 9月 03, 2014

台灣的勞工絕對有資格要求加薪!(9) – 2007-2012 國際勞動比較 | 鬼島狂想曲2.0

台灣的勞工絕對有資格要求加薪!(9) – 2007-2012 國際勞動比較 | 鬼島狂想曲2.0

台灣的勞工絕對有資格要求加薪!(9) – 2007-2012 國際勞動比較


▲ 2011-2012各國製造業時薪年成長率 (資料來源:美國勞工部)

▲ 2011年世界各國製造業的勞工時薪價值(資料來源:美國勞工部)
▲ 2012年世界各國製造業的勞工時薪價值 (資料來源:美國勞工部)
除了看2011, 2012兩年度情況之外,我們也來看看自1997年以來,各國的勞動時薪成本變化,可以非常明顯看出台灣在1997年只有7美元成本的時薪,但到了2012年卻也只微幅提升到9塊多而已!
▲ 各國勞工時薪成本比較列表 Since 1997(資料來源:美國勞工部)
▲ 美國勞工部的說明
▲ 2007-2011 時薪與物價成長率差距(資料來源:美國勞工部/製圖:永晨)
▲ 各國製造業工時/生產力的成長率 Since 2000(資料來源:美國勞工部)
▲ 各國生產力指數(資料來源:美國勞工部/製圖:永晨)
wrk hrs 
▲ 四小龍國家與美、日、德、OECD國家平均的工時統計 (資料來源:OECD,勞委會/永晨整理) 
▲ 製造業各子產業的平均時薪成本(資料來源:美國勞工部)
粉紅色的圓圈代表台灣,代表台灣在各種製造業領域的人力成本都超級低,如果將這張放在整體產業供應鍊的位置來看,台灣根本是處於低附加價值,無法創造出更多利潤空間,只能拼命的,不斷的Cost Down,不斷的節省人力與物料成本,不培養人才不自我研發新技術,不提昇自我價值,只會繼續讓產業沉淪下去。
China minium wage 
▲ 中國主要城市的基本工資標準與漲幅(資料來源:蘇筑瑄(2013))

Hourly Compensation Costs Report, U.S. Bureau of Labor Statistics | Division of International Labor Comparisons, 
BLS Spotlight on Statistics: International Labor Comparisons, U.S. Bureau of Labor Statistics | Division of International Labor Comparisons,
Productivity and Unit Labor Costs in Manufacturing, U.S. Bureau of Labor Statistics | Division of International Labor Comparisons,
Average annual hours actually worked per worker, OECD StatExtracts
國際勞動統計, 行政院勞工委員會 2013
中國大陸製造業單位勞動成本變動趨勢分析, Page.31, 蘇筑瑄 ,2013-06

2 THOUGHTS ON “台灣的勞工絕對有資格要求加薪!(9) – 2007-2012 國際勞動比較

月曜日, 9月 01, 2014

Damian Lillard hits buzzer-beating, game-winning, series-clinching 3 to oust Rockets in 6 (Video) | Ball Don't Lie - Yahoo Sports

Damian Lillard hits buzzer-beating, game-winning, series-clinching 3 to oust Rockets in 6 (Video) | Ball Don't Lie - Yahoo Sports

Damian Lillard hits buzzer-beating, game-winning, series-clinching 3 to oust Rockets in 6 (Video)

Dan Devine 
Ball Don't Lie
Dave Deckard of Blazersedge saw it coming.
So did Darius Soriano of Forum Blue and Gold.
Maybe you did, too. But for a moment there — after the Brooklyn Nets had forced Game 7, after the Dallas Mavericks had done the same, and after Chandler Parsons' putback reverse layup had given the Houston Rockets a 98-96 lead with nine-tenths of a second remaining — I thought Kevin McHale's crew might just pull this one out.
In that split-second, I forgot about Damian Lillard. And I'm afraid the Rockets did, too.
With 0.9 seconds left in Game 6, Blazers forward Nicolas Batum, who had just made a pivotal pull-up jumper (while appearing to slide his pivot foot in what wound up being an uncalled travel) to tie the game at 96 with 39 seconds remaining, prepared to inbound the ball, with Houston power forward Terrence Jones defending the ball. Blazers head coach Terry Stotts had stud power forward LaMarcus Aldridge, who'd torched the Rockets to the tune of 30 points through three quarters before missing all four of his tries in the fourth, stationed on the left block against the defense of Rockets center Dwight Howard, who had absolutely carried Houston down the stretch, scoring 13 points and grabbing six rebounds in the final frame.
The other three Blazers — Lillard, reserve point guard Mo Williams and shooting guard Wesley Matthews — were staggered along the right wing, opposite from Batum and Aldridge; the smart money seemed to be for Batum to look to work the ball into the big power forward for a chance to tie. (Batum confirmed this after the game.) But as the play began, Lillard streaked around the arc to the top of the key, completely losing Parsons with a quick first step. He came to the center of the court completely open; Batum gave him the ball.
"He was too open," Batum said. "I had to."
Lillard caught the pass, rose up and faded to his left from 25 feet out. He got the shot away, and in doing so reminded the Rockets what the Detroit Pistons,Cleveland CavaliersNew Orleans Pelicans and so many other teams have found out over the past two seasons: you don't want to give Damian Lillard one last shot.
Lillard's shot splashed through at the buzzer, giving the Blazers a 99-98 win over the Rockets that clinched a 4-2 win in this sensational best-of-seven first-round series. It was the perfect end to a game that had given us such gripping back-and-forth action — 14 ties, 16 lead changes, a fourth-quarter offensive duel between Howard and Robin Lopez, of all things — and the perfect cap to a series that featured three overtime contests and countless thrilling performances authored by two teams so evenly matched as to be ridiculous. Over the course of the six-game series, the Blazers and Rockets were separated by a grand total of two points, 672-670 ... and Houston was actually the one with 672, and they lost in six games. What an insane series.
Here's what it looked like inside the Moda Center when Dame dialed in, courtesy of Blazersedge's Ben Golliver:
I think it's fair to say that Portland's pretty stoked for the Blazers to be making their first trip to Round 2 since 2000
And here's what it looked like from courtside (spoiler alert: it looked cool):
"It hurts," said Howard, who finished with 26 points and 11 boards, capping a series in which he put up at least 20 and 10 in all six games while also playing as-good-as-you-can-expect defense on Aldridge and looking more like the Orlando Magic version of Dwight than anything we've seen in the last two years. "When you put everything you got on the floor, and somebody hits you with a dagger like that ... it's tough. It's a tough pill to swallow."
"Coach Stotts drew up a great play," Lillard told ESPN's Heather Cox after the game. "He wanted me to come to the ball hard. I figured it would be really tough to get my hands on it, but Mo and Wes, they set great screens. I was able to get to the ball, square my feet up, and I raised up and snapped my wrist. I got a good look, so I'm just excited it went in."
When you look back at the replay, though, Williams and Matthews didn't really set stonewall screens; this was just a matter of Lillard beating Parsons off the ball and to the spot to make the catch. But why was Parsons on Lillard in the first place? Why wasn't Patrick Beverley — who, even fighting through a fever and a month removed from a torn meniscus, is still the Rockets' best perimeter defender — locked on Lillard? Well, as Coach Nick of BBallBreakdown notes, Beverley was on Lillard at the start of the possession, with Parsons on Williams ... but the two switched assignments just before the whistle blew, apparently at the behest of James Harden, for reasons that remain unclear.
“We had a certain defensive scheme," Harden said after the game, according toJonathan Feigen of the Houston Chronicle. "He got loose and made a shot. He’s been making shots all night.”
But what was that "certain defensive scheme?" Why did that switch — whether called for by Harden, or dictated by something else — happen? Was it so that, once Lillard started running off the Williams and Matthews screens, Beverley or Harden could quickly pop out on Lillard and head him off at the pass as he flashed to the ball? If that was the case, then why didn't a second switch happen once Lillard broke free?
The latter likely owes to an instruction provided by McHale during a timeout immediately preceding the final possession:
It appears McHale is telling his players to just stay with their guys on the final possession, and not to switch their assignments or switch on screens. After the game, McHale told reporters that his specific instruction was not to give up a 3-pointer, a note confirmed by Howard during his trip to the podium. But if he's telling his players not to switch screens on the perimeter to make sure that nobody streaks wide open, how does that jive with the "no threes" plan?
Also, why was Harden on the court when what the Rockets needed was a stop? Why not take him off the floor in favor of backup point guard Jeremy Lin, who had helped hold Lillard to an 0-for-2 mark in the final quarter before that fateful final shot?
The more I watch the play and the more I think about it, the more thoroughly I'm confused about how the Rockets tried to accomplish the goal they said they wanted to accomplish. I think the Rockets were, too. This is probably why they didn't accomplish it.
"I've been telling you guys the whole series: You've got to always be in attack mode," Howard said. "You can never get back on your heels. And when you do, things like this happen."
“It’s the worst feeling I ever had in my life,” Parsons said, according to Feigen. “It’s crazy. You think the game is over, .9 seconds, you just got to get a stop and this locker room is totally different. We’re going home to play a Game 7 to move on. Instead, it’s over. There’s no words to describe the feeling.”
From Portland's perspective, though, Lillard — now an established late-game assassin who ranked fifth in the NBA in points scored in "clutch" situations (when the score is within five points in the final five minutes) and who shot 47 percent from the floor and 50 percent from long-distance in the final 30 seconds of games in which Portland was tied or trailed by three points during the regular season — had exactly the right words to describe what had just happened.
Those last two words kind of say it all, don't they?
Lillard finished with 25 points on 8-for-14 shooting, including a scorching 6-for-10 mark from 3-point land, to go with six rebounds, three assists and three steals in 43 1/2 minutes. Aldridge led the Blazers with 30 points and 13 rebounds. Harden scored a game-high 34 points on 9-for-15 shooting and went a perfect 12 for 12 from the foul line, to go with six assists, four rebounds and four steals to lead the Rockets. He becomes one of just 10 players since 1986 to put up 34 on 15 or fewer shot attempts.
The Blazers will face the winner of the first-round matchup between the San Antonio Spurs and Dallas Mavericks, which will be decided in Game 7 on Sundayafter the Mavericks tied the series at three games apiece on Friday. The Rockets will go home, devastated, and wonder what might have been.