[ Content | Sidebar ]

Zhujiajiao and Dianshan Lake

March 5th, 2022

A double day of sightseeing today in Qingpu district, which is in the far west of Shanghai. My first stop was Zhujiajiao ancient town. I didn’t have very high hopes considering the other old towns in the Shanghai suburbs have been over-commercialised and not very interesting, but this one was surprisingly quiet and well preserved. There are a couple of small paid exhibits including a garden, temple, and a craft museum.

Zhujiajiao ancient town

Next I rode all the way to the end of line 17 to try to get to Dianshan lake, Shanghai’s largest lake. I was going to walk there but thought better of it and got on a bus. The place you want to go to is called Xicai 西蔡 and there’s a long path around the lake with great views.

Dianshan lake

Years ago when I used take the train to Suzhou I was always fascinated by this massive skyscraper built seemingly in the middle of the countryside. I saw it again today on the other side of the lake. I still don’t know what it is. Only in China I suppose.

The mysterious tower

Shanghai World Financial Centre

March 1st, 2022

Last week I took a trip up to the 100th floor observation gallery in the Shanghai World Financial Centre the second tallest building in Shanghai. For a time it was also the second tallest building in the world, but it’s a fair way down the rankings now.

It’s the one on the left that looks like a bottle opener

The 100th floor ticket costs 180 which is cheaper, higher, and less crowded than the Oriental Pearl Tower, so triple win. You can save 60 RMB by only going to the 94th floor, but why bother.

The observation deck is pretty empty

The best time to visit is around sunset on a clear day, that way you get both the day and night scenery. The gallery isn’t ideal for taking photos in the day time though because the windows have a lot of glare, and there’s no outside area like the Taipei 101.

Sunset with the ever present haze

Filed in photos - Comments closed

MG: a simple lightweight Emacs clone

February 27th, 2022

For a while now I’ve been searching for a simple lightweight text editor to use when editing configuration files as root and when SSH-ing to remote machine. My normal editor is GNU Emacs with 15+ years of accumulated baggage which makes it pretty slow to start up. I’ve tried the various workarounds like the Emacs daemon and TRAMP but it still feels like a lot of faff compared to just SSH and starting an editor. I’ve also tried nano and vi, but my Emacs muscle memory makes them too annoying to use.

Recently I’ve settled on mg, a venerable Emacs clone that’s maintained as part of the OpenBSD base system and also available on Linux.

It starts up instantly and with the minor configuration tweaks below is pretty ergonomic.

global-set-key "\^z" undo
global-set-key "\^?" delete-backward-char
global-set-key "\^h" delete-backward-char
global-set-key "\e[1;3C" forward-word
global-set-key "\e[1;3D" backward-word
global-set-key "\e[1;5C" forward-word
global-set-key "\e[1;5D" backward-word
 
auto-execute *.c c-mode
auto-execute *.h c-mode
 
make-backup-files 0
set-default-mode indent
set-fill-column 72

Filed in linux - Comments closed

Shanghai City Centre

February 25th, 2022

Not much here, just a photo, but it’s somewhat remarkable since I almost never come to the city centre since I moved here.

Probably the best thing you can do here is ride the yellow and white ferry. Zig-zag across on the different lines. It’s quite fun.

Filed in photos - Comments closed

Major new NVC version 1.6.0

January 25th, 2022

Recently I’ve been doing a lot of work on my VHDL simulator and I’ve just released the first new major version in over a year and a half.

Download: nvc-1.6.0.tar.gz

This release is signed with my PGP key ID 74319F1A: nvc-1.6.0.tar.gz.sig

This release contains many improvements and bug fixes detailed below, but the highlights are much improved language support, especially for configurations and some VHDL-2008 features, as well as better debugging support.

  • Name resolution and overload resolution has been completely rewritten which should fix a number of long-standing issues.
  • The elaboration phase was largely written which fixes a number of long-standing issues and significantly improves elaboration speed.
  • VHDL-2008 IEEE standard libraries are now built and installed in addition to the VHDL-1993 libraries.
  • The VHDL-1993 standard libraries are now derived from the Apache 2.0 licensed sources from VHDL-2019.
  • There is now a project website at https://www.nickg.me.uk/nvc/. Please link to this in preference to the GitHub project page.
  • Compiled VHDL code now includes DWARF debug information which is used for runtime stack trace if libdw or libdwarf is installed.
  • Added support for VHDL-2008 reduction operators, match operators, and condition conversion.
  • Added support for VHDL-2008 element resolution.
  • Variable assignment now supports aggregate targets.
  • The --relax=impure option allows pure functions to call impure functions.
  • Added support for VHDL-2008 “all” sensitised processes.
  • Added support for ports and generics in block statements.
  • Added support for the ’BASE attribute.
  • Type name now allowed in element association choice (#407).
  • Implement textio READ procedure for REAL.
  • LLVM 6.0 or later is now required to build.
  • Added support for MINIMUM, MAXIMUM, and TO_STRING predefined operators in VHDL-2008.
  • VCD files are now generated from FST data in a similar manner to fst2vcd(1). This should improve compatibility with other tools.
  • Added support for ’LAST_ACTIVE attribute (#423).
  • Added support for ’DRIVING and ’DRIVING_VALUE attributes.
  • Added a new option --ieee-warnings=off to disable warning messages from the standard IEEE packages.
  • Support for configurations has been significantly improved (#372).
  • Added support for VHDL-2008 delimited comments.
  • Added support for guard expressions on blocks.
  • Added support for guarded signals.
  • Added support for HREAD, HWRITE, and other TEXTIO additions in VHDL-2008.
  • Code generation now happens in parallel when LLVM is built with multi-threading enabled.
  • Link time optimisation (LTO) is now enabled for release builds where supported.
  • The default assertion failure message for certain simple scalar comparisons now shows the values of the left and right hand sides.
  • Added support for VHDL-2008 conditional variable assignment statements.
  • Added support for VHDL-2008 extended bit string literals.
  • Non-globally-static actuals allowed in port maps in VHDL-2008 mode.
  • Added support for VHDL-2008 sequential conditional signal assignment statements.
  • Added basic support for package generics and package instantiation.
  • Nested arrays can now be included in the waveform dump but only if the --dump-arrays option is passed. This is disabled my default due the significant performance and memory overhead.
  • Added support for record types in waveform dump (#216).
  • Added support for foreign subprograms using the VHPIDIRECT protocol.
  • Library build is now reproducible when running make -j.
  • Fix a constant folding crash with nested records.
  • Fixed a crash when a record aggregate contains an “others” association and the fields have array types with different lengths.
  • Fixed a stack overflow when a subprogram with unconstrained array arguments is called repeatedly in a loop (#414).
  • Fixed intermittent crash when evaluating nested constant records (#425).
  • Fixed missing import libraries on Windows (#424).
  • Standard libraries are now installed under $prefix/lib/nvc/ instead of $prefix/share/nvc.
  • New configure option --disable-vital disables building the VITAL packages whose license status is unclear.
  • Support for the LXT wave output format, which was deprecated in version 1.5, has been removed. Use the default FST format instead.
  • The fetch-ieee.sh script which did nothing since the last release has been removed.
  • The --codegen command, which has been deprecated since 1.3, was removed.
  • The --profile option now prints internal simulation statistics instead of the top processes by CPU time.

Filed in vhdl - Comments closed

New xcowsay release 1.6

January 22nd, 2022

A new year, a new version of Xcowsay! Just a few minor changes this time:

  • Fix portability issues with signed vs unsigned chars in the config file parser (thanks to Charlène Wendling).
  • The -t option now allows fractional time values (e.g. -t 0.5 to display for half a second).
  • Set window type hint to notification to avoid shadows and other decorations (thanks to Markus Demleitner).
  • Add support for right-to-left text (thanks to @ilevi-code).

Download: xcowsay-1.6.tar.gz

This release is signed with my PGP key ID 74319F1A: xcowsay-1.6.tar.gz.sig

Filed in xcowsay - Comments closed

Evergrande Spring

December 20th, 2021

Perhaps the last chance to sample Evergrande Spring, the mineral water from Evergrande, better known as world’s most indebted property developer. This is the low sodium version, it tasted like normal water.

Diversification is important in business

Filed in musings - Comments closed

Zhaojialou Ancient Town

December 15th, 2021

Here’s another one of those “ancient” towns in the suburbs of Shanghai. This one is called Zhaojialou in the south-west Pujiang area. It’s a bit so-so. Usually these towns are significantly better if they have some attraction you can visit like and temple or a garden, but this one is just some old houses and shops.

I walked there from the end of line 15 and across the river on a ferry. The best bit was the industrial area under the bridge where the ferry runs.

Zhaojialou

On the other size is Pujiang country park which is quite pleasant for a walk too.

Nanxiang Ancient Town

December 2nd, 2021

Last week I went for a walk around Nanxiang another one of these “ancient” water towns. It’s not really a separate town, just a few old streets in Shanghai’s Jiading suburb. You can reach there easily on line 11.

The best part is definitely Guyi garden which is the classical-style garden pictured above. I went on a weekday and it was pretty quiet. There’s also an extensive Buddhist temple which is free to get in. Definitely recommend this one over Qibao, but there’s much nicer old towns if you go to Suzhou or somewhere a bit further away from the city.

New NVC version 1.5.3

November 13th, 2021

I’ve released a new version 1.5.3 of NVC, the VHDL compiler I’m working on. This is hopefully the final bug fix release on the 1.5 branch containing the following changes back-ported from the development branch:

  • Handle access(2) returning EPERM in macOS sandbox.
  • Fix race when multiple processes concurrently update a library.
  • Fix --syntax command when file contains multiple design units.
  • Allow constant folding of nand/nor/xor/xnor.
  • Fix potential out of memory condition when evaluating complex assert expressions.
  • Fix incorrect result of mod operator with negative operands.
  • Fixed intermittent crash when evaluating nested constant records.
  • Buffer too small for printing TIME’HIGH.

nvc-1.5.3.tar.gz
nvc-1.5.3.tar.gz.sig

This release is signed with GPG key fingerprint 0784 505A DB5D 7D86 D2BD E6DA BCDB 295F 7431 9F1A. Download both the .sig and .tar.gz files and verify with:

gpg --keyserver pgp.mit.edu --recv-keys BCDB295F74319F1A
gpg --verify nvc-1.5.3.tar.gz

Filed in vhdl - Comments closed