# Patch connections in Virtuoso

Have you ever come across a situation where you have to connect a set of multi-bit wires with another set of multi-bit wires?

I have.

And I did not know how to connect them to each other. The problem was compounded by a requirement that one set of wires was named din<63:0> coming from one 64-bit input port. I had to connect this to a component in my schematic that had two 32-bit ports (D0 and D1). The wires had to alternate between these two ports. Thus din<63> was to be connected to D1<31>, din<62> to D0<31>, din<60> to D1<30> and so on.

I could not just short them together, because then Virtuoso would complain. I spent two hours trying to figure out a solution and did not know what to search for on Google. That was until I came across the Virtuoso Schematic Composer user guide ( Yes! I should have looked at it first), that mentioned “patchcord” connections. So that is what it was called.

Went back to my schematic inserted the ‘patch’ cell from the ‘basic’ library and all done. This is what my schematic looks like now. The symbol that looks like a “patchcord” or a “jumper” is the patch…. of course.

# Ubuntu 16.04 and Windows 10 dual boot – grub not showing up while booting

Life was going on as usual. I had Windows 10 (I am not going to bother trying to find out if it is Pro, Home or Enterprise or whatever it is called) installed on a Lenovo Z50 laptop. My work as an academic researcher demanded that I also have Linux. So enter Ubuntu 16.04 and the pains associated with maintaining a dual-boot system. A couple of months after I had stored a solid chunk of my work on the Ubuntu partition, my laptop suddenly decides that it does not want to boot into Ubuntu. I do not see the grub splash screen at power on and go straight into Windows. Searching around on DuckDuckGo (yes I know ‘google’ is a verb now, but I am sceptical) threw up some answers. The most common amongst them was to run a command on the Windows command prompt

bcdedit /set {bootmgr} path \EFI\ubuntu\grubx64.efi

Unfortunately that did not seem to help me. Thankfully I found an answer in a post on https://tutorialsformyparents.com/how-i-dual-booted-linux-mint-alongside-windows-10-on-a-uefi-system/

Somewhere down where the author talks about UEFI and boot managers, I found my clue. The idea is that in addition to Devices that one can boot from, there now exist options that allow the user to select, which boot manager to select. With Windows 10 and some Micrium Recovery tool that I had installed on my Laptop, the Windows boot manager had somehow been given preference and it would not detect Ubuntu that had been installed later. So now I had to go and figure out, how to do the same on my laptop. None of F9/F6/F5 keys would take me into the Boot Options menu.

This is where Stackexchange came to the rescue. Lenovo Z50 and some of the other laptops in that series have a “Novo” button (how creative with the name) that is defined as

So then I shut down my Laptop, pressed the “Novo” button and select Boot Menu.

I then reorder the boot managers so that Ubuntu is on top,

Save and Exit and voila! my grub splash screen is back and I am able to boot into Ubuntu.

Lessons learnt

1. Dual boot is tricky but doable
2. There is goodness and a lot of good people in this world
3. googling (sorry I meant searching) helps

# Citation key not visible in Mendeley – What should I do?

There are situations in your publishing career, where you have a few thousand references that you need to wade through, and cite in your document. For those of us using Latex and Bibtex to create their wonderful research papers, the bib files have a field called the citation key. Now in most cases, the citation key is the Author Name followed by the year. But if your library has grown really large and is synced in multiple places, the citation key sometimes have some funny suffixes. So now instead of a key called “Dabholkar2015”, you would have a key “Dabholkar2015a”. For those using Mendeley and Overleaf as their library manager and Latex editor respectively, the problem is compounded because Mendeley auto-generates the .bib file that you include in Overleaf. Now, since everything is in the “cloud” and “auto-sync”ed, you do not have any way of editing the .bib file in Overleaf. On top of that, Mendeley regenerates the .bib file every time there is a change and so any manual edits you make to the .bib file in your Overleaf project would be lost, the next time, the Mendeley library is refreshed.
Unfortunately, Mendeley have decided that citation keys should not be visible by default, so you have to turn them on. Here I’ll copy from an answer I found on StackExchange : Go to the menu->Tools->Options->Document Details, then choose the document type (for instance, Journal Article), then check the Citation Key box. Then, a field for Citation Key should be visible in the details pane on the right hand side of the window.

# wget files of a certain type from multiple folders on a website

A common requirement when one is trying to download log files archived on some websites is that one needs logs from a particular date each month or from a specific date, but from all machines where the logging is being carried out.

I recently faced such a situation. I was trying to download the route views from the Packet Clearing House website. This website archives router dumps from various locations worldwide and uploads them to their server neatly arranged under various folders.

The content is organised as follows.

Home => Resources => Routing Data => IPV4 Daily Snapshots => <Year> => <Month> => <Route Location> => <Route_filename.Year.month.date.gz>

Now I needed the routing data from all locations, for 2017.04.01, so I used ‘wget‘ that is commonly available in almost all Linux installations to get the files. The wget command I used was

wget -r --accept "*.04.01.gz*" --level 2 "https://www.pch.net/resources/Routing_Data/IPv4_daily_snapshots/2017/04/"

# Use the desVar value in Ocean script

I have an Ocean script that has a few design Variables defined using desVar as follows

desVar("simTemp" 27)
desVar("simVdd" 1.0)

simVdd is my supply Voltage. I have to measure the propagation delay of my circuit and for that I need to find the delay between my input signal crossing the vdd/2 value and the output signal crossing the vdd/2 mark. In most cases, when the supply voltage is a constant, the calculator expression for delay is

delay(?wf1 v("/D1" ?result "tran") ?value1 0.5 ?edge1 "rising"  ?nth1 1 ?td1 0.0 ?wf2 v("/CMPLT32" ?result "tran") ?value2 0.5 ?edge2 "rising"  ?nth2 1 ?td2 nil ?stop nil ?multiple nil)

However now in my case, because the supply voltage was changing with each run, I needed a calculate the vdd/2 value at run time in my Ocean script.

The correct way to do this is as follows.

halfVdd = evalstring(desVar("simVdd"))/2.0

Of course the reference manual would have a long description of the correct way and the different options that can be used with evalString, however I was led in the correct direction by this post.

Also note the 2.0 in the denominator. Without the 2.0, I ended up having the halfVdd value set to ‘0’ when simVdd was 1, as it was doing an integer division and not treating the evaluated value as a real number. This was something that I had to figure out myself.

And then the delay expression would be

delay(?wf1 v("/D1" ?result "tran") ?value1 halfVdd ?edge1 "rising"  ?nth1 1 ?td1 0.0 ?wf2 v("/CMPLT32" ?result "tran") ?value2 halfVdd ?edge2 "rising"  ?nth2 1 ?td2 nil ?stop nil ?multiple nil)

# Grouping two figures together in Latex

There are instances when one want two figures to be placed on a single page. One has space for the two figures, but for some reason Latex decides to place them on two separate figures. What one can do in this case is include both the graphics in a single figure structure as follows

\begin{figure}[t]
\centering
\includegraphics[width= 0.9\columnwidth]{myfig1.pdf}
\caption{Caption 1}
\label{fig:myfig1}

\includegraphics[width= 0.9\columnwidth]{myfig2.pdf}
\caption{Caption 2}
\label{fig:myfig2}
\end{figure}



This will group the two graphics together and place them on a page as a single entity. And because each graphic is followed by a caption, they will receive separate figure numbers.

# Flushend package to balance columns on the last page in Latex

When using the biblatex-ieee package, the last line of the last citation may be flushed too much to the left with flushend. Adding the keeplastbox option when loading the packages fixes this.

\usepackage[keeplastbox]{flushend}