2021年8月18日 星期三

【Windows】跳過商用PC螢幕保護程式

採用微軟系統管理方案的公司,出於保護公司資料的目的,螢幕會在設定時間後自動進入螢幕鎖定保護模式,使用者需鍵入密碼才能繼續使用電腦,但是,如果使用者是在家辦公的話,該功能就顯得浪費時間了。

一般而言,通常使用者無權更改螢幕保護程式的相關設定,如何能讓電腦不要進入保護模式呢?網路上有很多方法,包括使用特定軟體程式模擬MOUSE移動等。最後採用的簡易方案是一個POWER SHELL SCRIPT,keepawake.ps1。用POWER SHELL執行,簡單。


$wsh = New-Object -ComObject WScript.Shell
while (1) {
$wsh.SendKeys('+{F15}')
Start-Sleep -seconds 59
}

 

2020年5月11日 星期一

【VIM】以VIM做SV工具


VI(M)的使用經驗起自文字終端機的時代,包括最早的行編輯器,到全螢幕編輯。晚近則是ECO時手動修改NETLIST的經驗,一 般的EDITOR碰到體積龐大的NETLIST(印象好像是幾百MB,或是GB等級),會轉不過來,或轉不動,但是VI卻依然輕鬆自如。VIM號稱是Linux的標準瑞士刀,從小型的EMBEDDED裝置到各式PC(包括MACOS),伺服器,都可見其蹤影。桌面環境,包括Windows,也有GVIM(視窗版)可用。可以說,以此一招,可以闖江湖矣!

最近的經驗是DDR4 Behavior Model的開發,環境則是 Red Hat Linux 桌面,這次算是比較長時間持續地使用,所以把VIM的一些經驗整理存參。

  • Motion
    • $                    ## end of the line
    • 0                    ## start of the line
    • ^                   ## the 1st none-space char of the line
    • g_                   ## last none-space char of the line
    • w,W               ## next word/WORD start
    • e,E                 ## next word/WORD end
    • b,B                ## prev word/WORD start
    • ge,gE            ## prev word/WORD end

    • G                   ## end of the file
    • gg                 ## start of the file
    • fC                  ## find right occurrence of `C` on the current line
    • FC                  ## find left occurrence of `C` on the current line
    • ;                     ## find again on the current line
    • :set number   ## show line number
    • :100               ## goto line 100
    • 100G             ## goto line 100
    • 3w                 ## next 3 word
    • /pattern        ## search pattern forwardly
    • ?pattern        ## search pattern backwardly
    • /\<word\>   ## search word matched
    • *,#                 ## search word matched at current cursor for/back
    • n                   ## search, next forward one
    • N                  ## search, next backward one
    • ctrl+F           ## page forward
    • ctrl+B           ## page backward

  • text object: chunk of text, word, sentence, and paragraph
    • aw     a word (includes surrounding white space)
    • iw   inner word (does not include surrounding white space)
    • it  Applies to everything in current xml/html tag
    • i{     Applies to everything inside nearest curly brackets
    • as      A sentence
    • is       inner sentence
    • ap    a paragraph
    • ip     inner paragraph


    •    
  • Verbs(Command)
    • x    Delete character under the cursor
    • r    Replace character under cursor with another character
    • s    Delete character under cursor and move to insert mode
    •  
    • d    Delete text specified by motion
    • c    Delete text specified by motion and go into insert mode
    • y    Yank (copy) text specified by motion
    • v    Visual selection(V for line vs. character)

  •  Combining Verbs with Motions
    • d$      delete to the end of the line
    • cf)   change through the next closing parentheses
    • yG      copy everything through the end of the file
    •  
    • ciw    change in word
    • daw  dele a word
    • ci(      change inner ()
    • yit      copy the contents of an html tag
    • yy      yanks the current line
    • dd     deletes the current line
    • cc      changes the current line

  • 一般型式
      • 一次:
      • 移動:
  •  
  •  
  •  
  •  

REF
  1.  Learning Vim in 2014: Vim as Language
  2. Learn vim For the Last Time: A Tutorial and Primer
  3. youtube, Mastering the Vim Language 
  4. MIT missing-semester lectures: Editors (Vim)
  5.  





2017年12月13日 星期三

【SV 學習筆記】multi-dimension associative array

DDR4 有不同的bank group, bank address, Model 以SV之associative array實作


parameter BG=4, BA=4;
logic [15:0] memory[BG][BA][int]; // BG, BA size const

foreach(memory[g, a]) // check array size
  $display(g,"  ", a, memory[g][a].size);

2011年2月27日 星期日

Successful Stories Open Source Business

Open Source Software and Open Source Product Design

How to leverage:
1. open source software, (most of player created some dedicated sw on top of open source sw, besides service and contract business)

2. power of community

3. open source business model, sucessful story


3.1 CollabNet
OpenSource Thought Leader and CollabNet Founder Brian Behlendorf http://www.sramanamitra.com/2008/04/07/distributed-development simplified-collabnet-founder-brian-behlendorf-part-1/


  • 利用OPEN SOURCE SW,低成本優勢,創設新公司
  • Brisbane, Calif.-based CollabNet
    Collaboration software, Subversion, www.collab.net, fund: Benchmark Capital in July of 1999.

    The term free software made it sound like an anti-capitalist movement, yet the reality is we were hardcore capitalists. We liked a lot of the attributes of that type of software and felt a re-branding effort was needed. That is when the term OpenSource was coined.

    "how the community formed, how it accomplished tasks, how it made decisions and what tools were needed to support the effort."

    Appache share: 65%

    Red Hat emerging as support organizations

    to do in more abstract form. My goal was to distill it down to a science, make it repeatable, and take the answer to the rest of the software industry.

    software as a service, charge per user per month

    Product strategy: Any Subversion is all of Subversion, open source. Instead, CollabNet provides another, larger product: CollabNet TeamForge, a product that would be much less valuable without Subversion (which is what justifies our investwith ment), but clearly a different product providing integration with commercial tools.
3.2 SpringSource
enterprise Java
We had five founders, and we bootstrapped the company with consultancy.

  • consulting and training
    Writing the book,  to help build my personal brand as a consultant. 
  • At first with Spring it was the same mentality, but it rapidly became apparent that it was at another level. Downloads went from tens of thousands to hundreds of thousands to millions.
  • Fundamentally our model is one that recognizes that the OpenSource software is great. It is better than any other alternatives, but we provide things around it which make Spring better, and we charge for those additions.
3.3 SugarCRM
From Dyslexia to SugarCRM: John Roberts
http://www.sramanamitra.com/2008/12/11/5178/
  • I started looking at business two ways. There is the traditional way, which is to hire engineers, get product managers, write your MRD, and because you are the smartest people on earth you build it in secret and launch it with an expensive sales force. I started to question that process. Does that manufacturing process really result in the highest quality, most innovative software on the planet?

  • The mentality was that geeks were not going to be interested in things which solved business problems.

  • We all resigned together and started SugarCRM on April 10, 2004, without any angel or VC money. It was the three of us, each in his own house with headphones on, writing and designing code and posting it up on SourceForge.net. We did that for three months.

    We chose to give away everything we wrote from scratch. Meanwhile we had mortgage payments and three pregnant wives. We had no income, and we were giving away everything we were working on.

    When people found out we were OpenSource there was hesitancy.
  • The three editions are Sugar OpenSource, otherwise known as the Community Edition, which is totally free. The second edition is Sugar Professional, which is sold under a subscription similar to RedHat Enterprise Linux. The difference is we own the copyright. We provide a one-page commercial license that says not to redistribute it. We also have our Enterprise Edition, which has about 25% more functionality. It also comes with support and training, both on-site and on-demand.
3.4 XMIND
open source free mind map software with 2 edition
1. free
2. time-limited per user charge

WebCollection

1. Building a standard micro architecture, Cortex Microcontroller Software Interface Standard (CMSIS)
(http://www.embedded-europe.com/showArticle.jhtml;jsessionid=52MYK5GTZ4AGDQE1GHPSKHWATMY32JVN?articleID=220301398ARM's )

2. Embedded Europe, ESD
http://www.embedded-europe.com/

3. FreeOpenEDASW
Fedora Electronic Lab, collection, integration in Fedora with a lot of open software
http://chitlesh.fedorapeople.org/FEL/

4. OpenCores
http://opencores.org/

5. Embedded OS




Ubuntu Altera Free Web Edition Installation


1. problem during install
>>export: 137: 3000.00: bad variable name

2. found a fix at Alter forum(root cause: dual core freq)
modify the following file, line 147
/altera/10.1/quartus/adm/qenv.sh
original:export QTB_CPU_FREQ=`cat /proc/cpuinfo | grep "cpu MHz" | cut -c 12-18 | uniq`
fix: export QTB_CPU_FREQ=`cat /proc/cpuinfo | grep "cpu MHz" | cut -c 12-18 | head -1`

3. install device package
altera/10.1/quartus/bin/quartus_sh  --qinstall -qda "10.1_quartus_free_linux/altera_installer/bin/../../devices/subscription/XXXX.qda" -show_qt_progress

## XXXX.qda, check uncompressed directory "device" 

4. environment variable,  .bashrc
export PATH=${PATH}:/home/tools/altera/10.1/modelsim_ase/bin
export PATH=${PATH}:/home/tools/altera/10.1/quartus/bin
xport QUARTUS_ROOTDIR_OVERRIDE=/home/tools/altera/10.1/quartus

## source
>>> .  ~/.bashrc

ModelSim


##  creates a design library
vlib work
## mapping between a logical library name and a directory by modifying the modelsim.ini file
vmap work work  
## compiles Verilog source code and SystemVerilog extensions into a
## specified working library (or to the work library by default
vlog  -work work tcounter.v 
             
vsim -f sim.f -do sim.do tcounter 
vsim -view counter.wlf 

===============
file: run
===============

vlog -incr  tcounter.v
vsim -f sim.f -do sim.do
===============
file: sim.f

===============

-c
-L  ../resource_library/parts_lib/
-wlf tcounter.wlf
test_counter
===============
file: sim.do
===============

run -all
quit -sim
===============
           
Ref
1. ModelSim User's Manual
2. ModelSim Reference Manual
3. ModelSim Tutorial