STOCK BASED COMPENSATION - Stock-based compensation expense (Details) - USD ($)
$ in Thousands
12 Months Ended
Jun. 30, 2020
Jun. 30, 2019
Jun. 30, 2018
Employee Service Share-based Compensation, Allocation of Recognized Period Costs [Line Items]      
Stock-based compensation expense $ 2,888 $ 2,890 $ 3,208
Cost of revenues      
Employee Service Share-based Compensation, Allocation of Recognized Period Costs [Line Items]      
Stock-based compensation expense 121 347 360
Research and development      
Employee Service Share-based Compensation, Allocation of Recognized Period Costs [Line Items]      
Stock-based compensation expense 2,022 2,045 1,873
Sales, general and administrative      
Employee Service Share-based Compensation, Allocation of Recognized Period Costs [Line Items]      
Stock-based compensation expense $ 745 $ 498 $ 975